Here is my .htaccess file (it's very basic):
- Code: Select all
#AddType text/x-component .htc
RewriteRule ^new/$ /new.php
RewriteRule ^new$ /new/ [R]
RewriteRule ^films/$ /films.php
RewriteRule ^films$ /films/ [R]
RewriteRule ^offline/$ /offline.php
RewriteRule ^offline$ /offline/ [R]
RewriteRule ^contact/$ /contact.php
RewriteRule ^contact$ /contact/ [R]
RewriteRule ^films/([a-zA-Z0-9-]+)/$ /films.php?mov=$1
RewriteRule ^films/([a-zA-Z0-9-]+)$ /films/$1/ [R]
PHPinfo() is showing that mod_rewrite is working, but .htaccess appears to be ignored completely! The rewrites work if I remove it from the root directory and making changes to it makes no difference.
I have bashed the .htaccess file and it's giving me "command not found" errors on every line, including "RewriteEngine on" and "RewriteBase /", It's also throwing me an "error near unexpected token" message on line 19.
I'm not expert in this but this has got be baffled - I've Googled but have not found anything like what I'm experiencing. It's really confusing me that the rewrites from domain.loc/films/ to /films.php are still working even when I completely remove the .htaccess fils from the folder.
Oh - when I upload to a web server I use for my actual hosting, it works fine, even with query strings, so it's presumably something to do with my setup rather than my .htaccess...
Any help you be appreciated!