Forum Moderators: phranque
i.e
i use the mod rewrite for:
RewriteRule ^dir1/(.*)\.html somefile.php?id=$1 [L]
and the error is for the page
http://www.example.com/dir1/.html
what i get when i go to this url is 403 Forbidden page.
does any one know how to solve that issue?
Thanks for your help :)
[edited by: jdMorgan at 1:26 pm (utc) on Nov. 7, 2008]
[edit reason] example.com [/edit]
RewriteRule ^dir1/([^.]+)\.html$ somefile.php?id=$1 [L]
For purposes of rule-ordering, this would be classed as an external redirect, and should therefore precede all of your internal rewrite rules (Place external redirect rules first in your .htaccess file, in order from most-specific-pattern to least-specific pattern, followed by your internal rewrites, again in order from most-specific-pattern to least-specific pattern).
This rule will detect "/.html" (.html file extensions without filenames), and return a 410-Gone response:
RewriteRule ^([^/]+/)*\.html$ - [G]
If you can find any links on the Web pointing to "/.html" pages on your site, you may be able to determine where the links were intended to point. If so, you can 301-redirect these bad links to a valid page. But until it is established where the links were supposed to point, the 410 is the proper response.
It is also possible that these "/.html" URLs were "exposed" by incorrect coding or ordering of your rewrites and redirects, so read the above description of proper rule ordering carefully, and make sure that your code is ordered as described.
Jim