Forum Moderators: phranque
RewriteEngine On
RewriteRule ^(.*)\.html index.php?$1
that worked fine. but in new server I get a 404 error and this on log file :
File does not exist: /usr/local/apache/htdocs/home/reza/public_html/index.php
when I want to see a page link test.html I see this error in explorer window :
The requested URL /home/topontv/public_html/index.php was not found on this server.
Can anyone help me about this problem?
thanks.
1st: Comment out the lines in the .htaccess file:
# RewriteEngine On
# RewriteRule ^(.*)\.html index.php?$1
Now try to open some of the files you know are there. If they open and you do not get a 404 then you know they are there.
If you do get a 404, you may need to re-upload the site.
2nd: Let's fix the syntax of your .htaccess rewrite
RewriteEngine On
RewriteRule ^(.*)\.html$ /index.php?$1
I added a $ to the left side if the rule as a hard ending, and a leading / to the right side as is required in the .htaccess file. (In the httpd.conf file the slash should be removed.)
Hope this helps.
Please, let us know how it turns out.
Justin