Submit Your Article Forum Rules

Results 1 to 9 of 9

Thread: Redirect?

  1. #1
    Senior Member
    Join Date
    Jun 2004
    Posts
    119

    Redirect?

    Hello,

    Can someone remind me how you make "mysite.com", "www.mysite.com, and
    http://mysite.com all point to "http://www.mysite.com"?

    I just want to make all forms of the URL point to the one main URL but
    can't recall where to do it or how to do it.


    I do have this in the .htaccess file but I am not sure if it is it

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

    Thanks,

    Bob

  2. #2
    Junior Member
    Join Date
    Dec 2004
    Posts
    2

    Re: Redirect?

    Mine's a little different. I'm certainly no coding expert, but it works:

    RewriteEngine on
    Options +FollowSymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www\.domainname\.com
    RewriteRule ^(.*) http://www.domainname.com/$1 [L,R=301]

  3. #3
    Senior Member
    Join Date
    Jun 2004
    Posts
    119

    Re: Redirect?

    Thanks Bob,

    I think the one I have is doing the job pretty well.

    However, I now have added a sub domain of "jobs.usernomics.com" that
    also works with Usability & User Interface Design - Job Listings but it does not work with
    http://www.jobs.usernomics.com or with www.jobs.usernomics.com.

    So I would like to point the latter two to one that works such as
    "jobs.usernomics.com". Would another script in my htaccess file do
    that? If so, do you know what the script would look like?

    Thanks Again,

    Bob

  4. #4

    Re: Redirect?

    The following seems to work OK:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    I think I am not wrong when I say that
    Code:
    http://www.jobs.usernomics.com
    is not a valid URL
    You can't use the www when there is a subdomain name like jobs in front of your domain name.
    Chris
    There is no failure until you give up.

  5. #5
    Senior Member
    Join Date
    Jun 2004
    Posts
    119

    Re: Redirect?

    Oh my. I missed the whole point. That's why http:/www and www. do not work.

    Thanks for pointing that out. Much appreciated.

    Bob

  6. #6
    Senior Member Keimos's Avatar
    Join Date
    Jul 2003
    Location
    North Wales
    Posts
    523

    Re: Redirect?

    Hi ergobob,

    This might seem to easy but ask your ISP to give you the option to have www or , mysite.
    This is a hosting issue as www.mysite.com is the same as mysite.com if allowed by your host


    Regards
    Keimos
    Keimos IT - Always learning something new each day
    www.keimos.co.uk , www.pengolf.co.uk , www.cbt4u.co.uk my hobby sites

  7. #7
    Moderator Tiggerito's Avatar
    Join Date
    May 2004
    Location
    Adelaide, Australia
    Posts
    550

    Re: Redirect?

    On a related note, you can use Googles WebMaster Tools to specify if they will include the 'www.' on links to your website.
    by Tony McCreath (Tiggerito)
    owner of Web Site Advantage

  8. #8
    Junior Member
    Join Date
    Jun 2007
    Posts
    3

    Lightbulb Re: Redirect?

    Yes in Google webmaster tool you need to register your site in that you have the option to select Preferred Domain which will do it all for you, save your time .

  9. #9
    WebProWorld MVP SemAdvance's Avatar
    Join Date
    Dec 2005
    Posts
    1,037

    Re: Redirect?

    Quote Originally Posted by mccreath View Post
    On a related note, you can use Googles WebMaster Tools to specify if they will include the 'www.' on links to your website.
    Quote Originally Posted by aden View Post
    Yes in Google webmaster tool you need to register your site in that you have the option to select Preferred Domain which will do it all for you, save your time .
    This only fixes things with Google. The htaccess file approach above fixes all canonical issues with all search engines.

    Peace

Similar Threads

  1. .htaccess, can I redirect a redirect?
    By T-G in forum Google Discussion Forum
    Replies: 3
    Last Post: 01-25-2009, 09:28 PM
  2. 301 redirect
    By hwajcman in forum Google Discussion Forum
    Replies: 9
    Last Post: 08-11-2007, 04:31 PM
  3. 301 redirect
    By rms7design in forum Search Engine Optimization Forum
    Replies: 3
    Last Post: 08-01-2007, 05:37 AM
  4. 301 redirect
    By jasonashby in forum Search Engine Optimization Forum
    Replies: 11
    Last Post: 04-17-2006, 05:23 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
  •