Results 1 to 4 of 4
  1. #1
    general fuq mrbshouse's Avatar
    Join Date
    January 18th, 2005
    Location
    Argieville
    Posts
    1,381
    301 on the index creating a loop>>>HELP
    Hey ABWebers,

    I've run into an issue when trying to put a 301 on the non-www version of the main index, so that it goes to the www version of the page. When I create the 301 in htacess for the http folder, since the www folder is a mirror of it the same 301 is waiting in the www folder, which creates one nasty loop.

    How can I create a 301 for the main index in the http folder without it being added to the www folder automatically, while hosting on a VPS using cpanel?

  2. #2
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    4,053
    You dont have to redirect the linux folders, is that what you're trying to do? Makes no diff that www and html_public folders are the same. .htaccess just needs to go in one and it'll show up for both - that's normal and shouldn't cause a loop unless there's some other problem going on.

    Do you have any other redirects goiing on the site?

    RewriteEngine on
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    Never fails, and it's all done in cpanel hosting.

  3. #3
    general fuq mrbshouse's Avatar
    Join Date
    January 18th, 2005
    Location
    Argieville
    Posts
    1,381
    WW,

    I saw that fix in a search after I posted...I think that will be what I need to do. It cases a loop due to:
    RedirectMatch permanent ^/index.html$ http://www.domainname.com/index.html

    this then sends it to the www folder where it sees

    RedirectMatch permanent ^/index.html$ http://www.domainname.com/index.html

    meaning send it back to the same folder, read the htacess and start over ;-) The hosting company is having a hard time getting a hold of the concept that the 301 is a problem and I have never worked with hand coded rewrites.

    I am pretty sure this goes in the htacess file, but I already have rewrites set for hotlinking. Do I need to turn on the rewrite again or can I simply add
    that code below the rewrite in place?

    IE:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain.com$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com$ [NC]
    RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

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

    Thanks for looking into this ;-)

  4. #4
    general fuq mrbshouse's Avatar
    Join Date
    January 18th, 2005
    Location
    Argieville
    Posts
    1,381
    WW,

    That worked like a charm ONE BIG THANK YOU!!!!!!

  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Creating a search index
    By jackson992 in forum Programming / Datafeeds / Tools
    Replies: 14
    Last Post: January 1st, 2008, 11:41 AM
  2. Creating an Index
    By jackson992 in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: October 22nd, 2006, 05:11 AM
  3. Creating a Yahoo Style Index Page
    By nubizmedia in forum WebMerge (Fourthworld.com)
    Replies: 2
    Last Post: September 17th, 2004, 05:11 AM
  4. Creating index pages for multiple/uneven tiers
    By svenhassel in forum WebMerge (Fourthworld.com)
    Replies: 5
    Last Post: July 31st, 2004, 06:54 PM
  5. Creating a custom link on an index page
    By Synozeer in forum WebMerge (Fourthworld.com)
    Replies: 7
    Last Post: December 2nd, 2003, 11:50 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
  •