Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- .htaccess multiple page redirection


spiral - 10:27 am on Apr 1, 2009 (gmt 0)


OK, so this is what I'm using now, it's doing what I need, but I'm sure it's far from a model ,htaccess file.

<Files ~ "^.(htaccess¦htpasswd)$">
deny from all
</Files>
Options +FollowSymlinks
RewriteEngine on
RewriteOptions MaxRedirects=10
RewriteRule ^cj/consulta/index.php$ [mysite.com...] [R=301,NC]
RewriteRule ^indexbc70.html$ [mysite.com...] [R=301,NC]
RewriteRule ^(.*)index\.php(.*)? [mysite.com...] [R=301,L]

# Externally redirect requests for index.html in any directory to "/" in that directory
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ [mysite.com...] [R=301,L]

# Externally redirect requests for *all* non-canonical hostnames to canonical hostname, including case errors and appended FQDN indicator and/or port numbers.
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$
RewriteRule ^(.*)$ [mysite.com...] [R=301,L]

AddHandler application/x-httpd-php5 .html

------------------------------------
Now let's say I wanted the site to redirect from www to non-wwww pages, is this the way?

RewriteCond %{HTTP_HOST} !^www\.mysite\.com$
RewriteRule ^(.*)$ [mysite.com...] [R=301,L]


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