PDA

View Full Version : htaccess + redirect



newconceptdesign
02-11-2007, 10:29 AM
I am working on htaccess redirect and have two options to go, but I don't understand the difference between them, mainly issue related to symbolic link and the line "AllowOverride FileInfo". Anyone to help me with that? Which one to use, and what is the difference between them?

1st option:

Options +FollowSymLinks
AllowOverride FileInfo
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

2nd option:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

Thanks
Andrew

amar
02-11-2007, 11:46 PM
I use the second option regularly and its working fine.

Webnauts
02-11-2007, 11:58 PM
RewriteEngine On

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.html? [NC]
RewriteRule ^(([^/]*/)*)index\.html?$ http://www.example.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

newconceptdesign
02-12-2007, 09:29 AM
Thanks.

As to your example, Webnauts. Do I have to use Rewrite Cond and Rule twice? What are these first two lines doing. I am not quite sure? Does it have anything to do with default home page file?

Andrew

Webnauts
02-14-2007, 06:26 PM
Thanks.

As to your example, Webnauts. Do I have to use Rewrite Cond and Rule twice? What are these first two lines doing. I am not quite sure? Does it have anything to do with default home page file?

Andrew

You can be sure that it is correct.

newconceptdesign
02-14-2007, 06:39 PM
I am sure :-)

Just hoped to understand it better, this is quite new to me. Anyway thanks for your time.

Andrew