Hi all,
I'm new to mod_rewrite and I'm having a problem where I need to move some rules from a virtualhost to an .htaccess file. AllowOverride is set to None in my main conf file. My virtualhost looks like:
<VirtualHost *:80>
ServerAdmin myemail@email.com
DocumentRoot /to/my/website
ServerName mywebsite.com
#RewriteEngine on
#RewriteRule /cybercamp(.*) "http://mywebsite.com/modules/cyber/index.php?id=35"
#RewriteCond %{HTTP_HOST} ^www.mywebsite.com$ [NC]
#RewriteRule ^(.*)$ http://mywebsite.com$1 [R=301]
</VirtualHost>
<Directory /to/my/website>
AllowOverride All
</Directory>
Everything works just fine when using the rules above.
I moved them into an .htaccess file and using redirects, etc. seem ok too. However, not all my RewriteRules work. Here's the .htaccess:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.mywebsite.com$ [NC] #Works
RewriteRule ^(.*)$ http://mywebsite.com$1 [R=301] #Works
RewriteRule /cybercamp(.*) "http://mywebsite.com/modules/cyber/index.php?id=35" # Doesn't Work
RewriteRule ^(.*)\.html$ $1.php [NC] #Works
Any suggestions?
Thanks in advance!