.htaccess file not working


#1

Hi, I have a htaccess file with the following content:

ErrorDocument 404 /error/index.php
ErrorDocument 500 /error/index.php
Options Indexes MultiViews FollowSymlinks
RewriteEngine On
RewriteRule ^forum/[a-zA-Z0-9-_]+-([0-9]+)/([0-9]+)/?$ /forum/viewforum.php?forum_id=$1&page=$2
RewriteRule ^forum/[a-zA-Z0-9-_]+-([0-9]+)/?$ /forum/viewforum.php?forum_id=$1
RewriteRule ^forum/[a-zA-Z0-9-_]+-[0-9]+/[a-zA-Z0-9-_]+-([0-9]+)\.htm$ /forum/viewtopic.php?topic_id=$1 [QSA]
RewriteRule ^(gallery|news|products)/[a-zA-Z0-9-_]+-([0-9]+)/([0-9]+)/?$ /$1/index.php?category_id=$2&page=$3
RewriteRule ^(gallery|news|products)/[a-zA-Z0-9-_]+-([0-9]+)/?$ /$1/index.php?category_id=$2
RewriteRule ^(gallery|news|products)/([0-9]+)/?$ /$1/index.php?page=$2
RewriteRule ^(news|products)/[a-zA-Z0-9-_]+-[0-9]+/[a-zA-Z0-9-_]+-([0-9]+)\.htm$ /$1/info.php?info_id=$2 [QSA]
RewriteRule ^(news|products)/[a-zA-Z0-9-_]+-([0-9]+)\.htm$ /$1/info.php?info_id=$2 [QSA]
RewriteRule ^[a-zA-Z0-9-_]+-([0-9]+)/?$ /index.php?category_id=$1
RewriteRule ^[a-zA-Z0-9-_]+-[0-9]+/[a-zA-Z0-9-_]+-([0-9]+)\.htm$ /index.php?page_id=$1
RewriteRule ^[a-zA-Z0-9-_]+-([0-9]+)\.htm$ /index.php?page_id=$1

The site works fine without the file (but I need the rewrite rules) but as soon as it’s uploaded i keep getting the same error on every page. My site is http://www.notyourhero.co.uk.

One further note is that the file is working fine on my local testing server and I have a .htaccess file on a site also hosted on this server which works fine. Appreciate if you could help. Thanks


#2

500 error? Means there’s a typo in there someplace.

Try removing the rewrite stuff and see if that works.


#3

Yeah removed the rewrite stuff and worked fine.


#4

Possibly a dumb suggestion, but have you logging in via ssh & editing it there? Try adding a carriage return at the end. That fixed a 500 error for me one time that I recall.