Page 5 of 5 FirstFirst 1 2 3 4 5
Results 61 to 62 of 62

301 Redirecting Domains

This is a discussion on 301 Redirecting Domains within the General Discussion forums, part of the vBulletin SEO Discussion category; Sorry for the multiple posts... I am just working fast and furious. This is the code I am now using ...

  1. #61
    Member
    Real Name
    Gary Mullins
    Join Date
    Jan 2006
    Location
    Nashville, TN
    Posts
    67
    Liked
    0 times
    Sorry for the multiple posts... I am just working fast and furious. This is the code I am now using to forward non-www incoming traffic to PCApex.com - Hardware Reviews, News &; Mods and it works! First time I have got a url rewrite to work in the root folder. Here is the code I am using:

    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    ErrorDocument 401 /errordocs/401.htm
    ErrorDocument 403 /errordocs/403.htm
    ErrorDocument 404 /errordocs/404.htm
    ErrorDocument 500 /errordocs/500.htm

    <FilesMatch "\.(gif|png|mp3|jpg|rar|zip|exe|php)$">
    Order Allow,Deny
    Allow from all
    Deny from env=bad_bot
    </FilesMatch>

    So, I wonder if there is a way to use that sort of syntax in the domain rewrites since this set of code actually works.

    EDIT // Getting closer! This time I got this error, it did rewrite both the non-ww and the domain from pimprig to pcapex but I received this error in FireFox when I loaded the url:

    The page isn't redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.


    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

    Here is the code I used to get that far.

    Options +FollowSymlinks
    RewriteEngine On

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

    ErrorDocument 401 /errordocs/401.htm
    ErrorDocument 403 /errordocs/403.htm
    ErrorDocument 404 /errordocs/404.htm
    ErrorDocument 500 /errordocs/500.htm

    <FilesMatch "\.(gif|png|mp3|jpg|rar|zip|exe|php)$">
    Order Allow,Deny
    Allow from all
    Deny from env=bad_bot
    </FilesMatch>

    FINAL EDIT //
    Woohoo! After alot of trial and error I finally got the root folder/URLs to redirect! Now a visitor can follow a link to something like pimprig.com/advertising.php and they will be forwarded to PCApex.com - PC Apex Advertising! Thanks for all of your help. I am now going to setup a redirect from www.subdomain.pcapex.com to subdomain.pcapex.com. I have been running with all these urls pointing to the same content for over a year now and have not noticed any penalties from Google. Instead of tempting fate I decided to fix the issue. Here is the code I ended up with for the root folder .htaccess:

    Options +FollowSymlinks
    RewriteEngine On

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

    ErrorDocument 401 /errordocs/401.htm
    ErrorDocument 403 /errordocs/403.htm
    ErrorDocument 404 /errordocs/404.htm
    ErrorDocument 500 /errordocs/500.htm

    <FilesMatch "\.(gif|png|mp3|jpg|rar|zip|exe|php)$">
    Order Allow,Deny
    Allow from all
    Deny from env=bad_bot
    </FilesMatch>
    Last edited by GlitterKill; 11-25-2007 at 08:35 PM.

  2. #62
    Senior Member
    Real Name
    Joseph Ward
    Join Date
    Jun 2005
    Posts
    23,847
    Liked
    32 times
    Blog Entries
    9

Page 5 of 5 FirstFirst 1 2 3 4 5

Similar Threads

  1. Redirecting Custom Rewrites outside forum folder
    By vissa in forum Bug Reporting
    Replies: 7
    Last Post: 03-10-2006, 06:55 PM
  2. 301 homepage
    By Ashley in forum General Discussion
    Replies: 2
    Last Post: 02-15-2006, 06:34 AM
  3. 301 Redirects .. built in?
    By Ace Shattock in forum General Discussion
    Replies: 1
    Last Post: 09-30-2005, 12:18 PM

Posting Permissions

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