Submit Your Article Forum Rules

Results 1 to 6 of 6

Thread: htaccess + redirect

  1. #1

    htaccess + redirect

    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

  2. #2
    Senior Member
    Join Date
    Aug 2005
    Posts
    297
    I use the second option regularly and its working fine.

  3. #3
    WebProWorld MVP Webnauts's Avatar
    Join Date
    Aug 2003
    Location
    European Community
    Posts
    9,028
    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]

  4. #4

    question to Webnauts

    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

  5. #5
    WebProWorld MVP Webnauts's Avatar
    Join Date
    Aug 2003
    Location
    European Community
    Posts
    9,028

    Re: question to Webnauts

    Quote Originally Posted by newconceptdesign
    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.

  6. #6

    Thanks Again - Webnauts

    I am sure :-)

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

    Andrew

Similar Threads

  1. Simple? htaccess 301 redirect
    By HG80737 in forum Search Engine Optimization Forum
    Replies: 10
    Last Post: 10-11-2009, 02:20 AM
  2. htaccess redirect
    By freehits in forum Web Programming Discussion Forum
    Replies: 3
    Last Post: 03-03-2008, 04:53 PM
  3. .htaccess redirect issue
    By rkstevens in forum Search Engine Optimization Forum
    Replies: 1
    Last Post: 01-14-2007, 11:11 AM
  4. .htaccess for 301 redirect ?
    By TransferTown in forum Other Engines/Directories
    Replies: 8
    Last Post: 01-06-2007, 01:26 AM
  5. Please help - 301 redirect a directory .htaccess
    By African-Safari in forum Search Engine Optimization Forum
    Replies: 1
    Last Post: 10-05-2005, 10:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •