Apache

Apache mod_rewrite: RewriteCond and RewriteRule

This Apache documentation for mod_rewrite are clear and comprehensive. This page does not intend to replace nor replicate the official documentation. However, some for of example-based tutorial may be helpful for some beginners to get them started. The examples below need to be completed and better annotated.

Let's start with the easiest example:

Let's say we want to redirect "home" to "/".

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteRule home / [redirect,last] # This example will not give the intended result!!
</IfModule>

Apache

https://www.apache.org/
https://httpd.apache.org/
https://en.wikipedia.org/wiki/Apache_HTTP_Server

http://linux.overshoot.tv/etc/apache2

https://wiki.gentoo.org/wiki/Apache
https://wiki.gentoo.org/wiki/Project:Apache/Troubleshooting

Enable/disable vhosts

In debian and derivatives, there are 2 directories, one with all the .conf for all the existing vhosts, and another one with enable vhosts by symlinking to the .conf files in the former directory. One can easily use a2ensite and a2dissite to enable and disable each vhost.

Syndicate content