Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Redirect html pages with htaccess


g1smd - 1:07 pm on Sep 30, 2012 (gmt 0)


What code have you tried already for this? You'll need a RewriteRule before all others to do it. However, it's usually bad form to mass redirect multiple URLs to one URL, especially if it's the root page of the site.

The canonical URL for the site root ends with a trailing slash.

The $1 all on it's own in an existing rule target opens your server to path injection. You need to prefix this with the protocol and canonical hostname.

Dump the ifModule container tags.

You need another redirect after your last redirect and before your first rewrite. This should redirect non-www requests to www.

RewriteRule ^.*index.html$ index.php [QSA]

Replace the leading .* with a more specific pattern. Escape the literal period in the index.html part of the pattern. This rule also needs the L flag.

redirect to our front web controller

This is not a redirect. It is an internal rewrite. Amend the comment.


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