Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- htaccess : redirect invalid page


g1smd - 8:59 am on Feb 25, 2013 (gmt 0)


The (.+) elements should be changed to a more specific pattern. See other discussion about using (.*) elements only a few hours ago. Both are equally bad for the same reasons.


With this rule,
RewriteRule ^(.*)$ /index.php [L]
requests for images and for CSS and JS files are rewritten too. It's a very bad idea as it leads to an infinite loop. You need a preceding RewriteCond to exclude internal requests for index.php from matching again and being rewritten again.

To simplify your site, have you considered extensionless URLs for pages? With this change, URL requests with extensions are served by real files (images, CSS, JS, etc) and extensionless URL requests for pages are served by the index.php file by passing parameters to it in a rewrite.

Non-existing URLs should return 404 status. Usually Apache does that, but your PHP script will need to do that.


Thread source:: http://www.webmasterworld.com/apache/4548356.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com