I have changed my hosting and get a 404 error on one website where we have using .htaccess file and code like this, now what happening sub-cat page showing 404 error http://www.natural-stones-india.com/sandstone/Golden%20Brown%20Black.html
.htaccess code is like this ----------- can anyone help?
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^sandstone/(.*).html$ product.php?sandstone=$1
RewriteRule ^slate/(.*).html$ product.php?slate=$1
RewriteRule ^marble/(.*).html$ product.php?marble=$1
RewriteRule ^granite/(.*).html$ product.php?granite=$1
RewriteRule ^artifacts/(.*).html$ product.php?artifacts=$1
RewriteRule ^page/(.*)/sandstone/(.*).html$ product.php?page=$1&sandstone=$2
RewriteRule ^page/(.*)/granite/(.*).html$ product.php?page=$1&granite=$2
RewriteRule ^page/(.*)/marble/(.*).html$ product.php?page=$1&marble=$2
RewriteRule ^page/(.*)/artifacts/(.*).html$ product.php?page=$1&artifacts=$2
RewriteRule ^page/(.*)/slate/(.*).html$ product.php?page=$1&slate=$2
RewriteRule ^(.*)\.html$ $1.php [nc]
RewriteRule ^action/(.*)/id/(.*)/cat/(.*)/sub_cat/(.*)shoppingcart.html$ shoppingcart.php?action=$1&id=$2&cat=$3&sub_cat=$4
RewriteCond %{HTTP_HOST} ^natural-stones-india.com
RewriteRule ^(.*)$ http://www.natural-stones-india.com/$1 [R=301,L]
<Files .htaccess>
order allow,deny
deny from all
</Files>
ErrorDocument 404 /missing.html
Try changing your access rights to the .htaccess file You should be able to change these through FTP.
You site seems fine, since this i working: http://www.natural-stones-india.com/product.php?sandstone=Golden%20Brown%20Black
OK, let's analyze some facts
Webserver does not respond with 500 Internal server error)
Conclusion: Your .htaccess file seems to be syntactically correct
Webserver does some of the rewrites correctly, also the custom error document is working
Conclusion: Your .htaccess file is actually read by the webserver
By the first look all rewrites based in the document root seem to work http://www.natural-stones-india.com/granite.html works, while http://www.natural-stones-india.com/granite/Pink%20Granite.html does not
Conclusion: You have a problem with relative paths
Possible solution:
RewriteEngine On
RewriteBase /
...
http://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteBase
Or set the rewrite targets absolute
e.g.
RewriteRule ^sandstone/(.*).html$ /product.php?sandstone=$1