Mod_rewrite rules in httpd.conf
Posted: Tue Nov 21, 2006 1:59 pm
What is needed to place your rewrite rules inside the httpd.conf file? I cannot get this thing to work and I am frustrated beyond all get out. I have tried a number things I found on google, and none of it appears to work. Here is what I have in my httpd.conf now: (note, this is for a virtual site on our network)
Are there other changes to make in the configuration file in order to get this to work properly?
Code: Select all
<VirtualHost *:80>
DocumentRoot /path/to/vhost/root
ServerName vhost.domain.com
<Directory /path/to/vhost/root>
AllowOverride All
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ - [S=2]
RewriteRule ^/([A-Za-z0-9-_]+)/APPNAME-VISIT-ID-([A-Za-z0-9]+)/?$ /index.php?p=$1&sid=$2 [L]
RewriteRule ^/([A-Za-z0-9-_]+)/?$ /index.php?p=$1 [L]
</IfModule>
</Directory>
</VirtualHost>