Page 7 of 18 FirstFirst 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 LastLast
Results 91 to 105 of 267
Like Tree3Likes

[How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects

This is a discussion on [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects within the General Discussion forums, part of the vBSEO SEO Plugin category; Originally Posted by Diver sorry for my dumb question. but i have several urls for my website how do i ...

  1. #91
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    1 times
    Blog Entries
    1
    Quote Originally Posted by Diver View Post
    sorry for my dumb question. but i have several urls for my website
    how do i for example 301 redirect
    www.mysite .org to www.mysite. com ?

    thank you so much in advance!
    Check Out : Changing Domains: Directing Old Site to the New Site with htaccess

  2. #92
    Member
    Real Name
    Jeff
    Join Date
    Jul 2009
    Posts
    31
    Liked
    0 times
    Quote Originally Posted by Diver View Post
    sorry for my dumb question. but i have several urls for my website
    how do i for example 301 redirect
    www.mysite .org to www.mysite. com ?

    thank you so much in advance!

    Domain name forwards to another url is handled through the company you have your domain name(s) registered with. This is done by you.

    For example if you use GoDaddy.com you would go into the domain manager, and select the domain you wish to forward. Then simple select forward, add the url you want it to forward to and then choose whether it's a temporary or permanent forward, and then save.

  3. #93
    Senior Member
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    7,097
    Liked
    4 times
    How are they all looking at the same website? Are they parked domains or addon domains?
    The Forum Hosting - Forum Hosting from the Forum Experts

  4. #94
    Member
    Real Name
    Jon
    Join Date
    Aug 2009
    Posts
    72
    Liked
    0 times
    In Google Webmaster Tools I have gone to "Site Configuration" > "Settings" and selected the www option under "Preferred domain". Then I get a problem:

    "Part of the process of setting a preferred domain is to verify that you own http://example.com/. Please verify http://example.com/"

    I have done the www verification by putting the google.html file into my /home/mainwebsite.html/ directory, no problems.

    But I have absolutely no idea how to verify my "example.com" address - have googled for about 30 minutes and cannot find any answer - hope you can help.
    Last edited by systemsfortraders; 08-16-2009 at 10:05 AM.

  5. #95
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    1 times
    Blog Entries
    1
    Quote Originally Posted by systemsfortraders View Post
    In Google Webmaster Tools I have gone to "Site Configuration" > "Settings" and selected the www option under "Preferred domain". Then I get a problem:

    "Part of the process of setting a preferred domain is to verify that you own Example Web Page. Please verify http://example.com/"

    I have done the www verification by putting the google.html file into my /home/mainwebsite.html/ directory, no problems.

    But I have absolutely no idea how to verify my "example.com" address - have googled for about 30 minutes and cannot find any answer - hope you can help.
    Joe didn't say change the Preferred domain in Google webmasters
    You just add these lines (in your htaccess file) if you want to use www

    Code:
    RewriteCond %{HTTP_HOST} !^www\.example\.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    And if you want to use non-www you can add these lines
    Code:
    RewriteCond %{HTTP_HOST} ^www\.example\.com$
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
    Change example to your site URL

  6. #96
    Member
    Real Name
    Jon
    Join Date
    Aug 2009
    Posts
    72
    Liked
    0 times
    You will notice in the 1st post there are 3 options, .htaccess, Google Webmaster and Lighttpd. It is not clear and I am not clear whether all options should be completed or just one of them.

    Being non-technical and not having a clue what Lighttpd is I went for the Google Webmaster option. So, that is the one I am having problems with and the one to which my initial query relates. Hope you can help as it is still a problem and I am concerned unless corrected in Google webmaster tools it will not be right.


    NOTE:

    I have now made the .htaccess changes. Two questions: 1. Having made these changes do I still need to do the Google Webmaster option ? 2. Should the line of code be:

    RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]

    RewriteRule (.*) http://www.systemsfortraders.com/forums/$1 [L,R=301]

    And, question 3 - what is lighttpd or should I not ask ?


    One last question is this - is there any preference for www. or non-www - e.g. is there any reason to chose one over the other ?

    Apologies for all the questions but its an area I am keen to clear up on.

  7. #97
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    1 times
    Blog Entries
    1
    Quote Originally Posted by systemsfortraders View Post
    You will notice in the 1st post there are 3 options, .htaccess, Google Webmaster and Lighttpd. It is not clear and I am not clear whether all options should be completed or just one of them.

    Being non-technical and not having a clue what Lighttpd is I went for the Google Webmaster option. So, that is the one I am having problems with and the one to which my initial query relates. Hope you can help as it is still a problem and I am concerned unless corrected in Google webmaster tools it will not be right.


    NOTE:

    I have now made the .htaccess changes. Two questions: 1. Having made these changes do I still need to do the Google Webmaster option ? 2. Should the line of code be:

    RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]

    RewriteRule (.*) http://www.systemsfortraders.com/forums/$1 [L,R=301]

    And, question 3 - what is lighttpd or should I not ask ?


    One last question is this - is there any preference for www. or non-www - e.g. is there any reason to chose one over the other ?

    Apologies for all the questions but its an area I am keen to clear up on.
    Choose what the version you will use in your site and add the code in your htaccess I change the codes to your site just copy and paste the version code in your htaccess file

    if you want to use www

    Code:
    RewriteCond %{HTTP_HOST} !^www\.systemsfortraders\.com
    RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]
    if you want to use non-www

    Code:
    RewriteCond %{HTTP_HOST} ^www\.systemsfortraders\.com$
    RewriteRule ^(.*)$ http://systemsfortraders.com/$1 [L,R=301]
    After add the code in htaccess you will not need to change your preferred domain

    Check Out Wiki : lighttpd - Wikipedia, the free encyclopedia

  8. #98
    Member
    Real Name
    Jon
    Join Date
    Aug 2009
    Posts
    72
    Liked
    0 times
    Thanks,

    From your response I think that the following is true, appreciate if you can confirm:

    1. I use the rewrite code "RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]", the first bit of code I mentioned in my original message?

    2. After making this change in .htaccess I do not need to make any changes to Google Webmaster tools or to lighttpd ?

    3. You did not answer my question "is there any preference for www. or non-www - e.g. is there any reason to chose one over the other ?"

    Thanks again for the quick responses.

  9. #99
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    1 times
    Blog Entries
    1
    Add this code in your htaccess and you are done
    Code:
    RewriteCond %{HTTP_HOST} !^www\.systemsfortraders\.com
    RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]
    2. Yes
    3. That's as you like if you want to use www or not there are doing the same thing

  10. #100
    Member
    Real Name
    Jon
    Join Date
    Aug 2009
    Posts
    72
    Liked
    0 times
    Thanks, again.

  11. #101
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    1 times
    Blog Entries
    1
    Quote Originally Posted by systemsfortraders View Post
    Thanks, again.
    You are welcome

  12. #102
    Senior Member
    Real Name
    Cagatayh
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    158
    Liked
    1 times
    Hi,
    I used this code but there is a issue. I have a subdomain so when i put the code, if i want to enter the subdomain, there is a problem.

    How can i use this code only for my main site ?
    For instance:

    www.mysite.com
    subdomain.mysite.com

    I only want to apply this code for my main site. if the url is subdomain.mysite.com the code musn't do something.

    Thanks

  13. #103
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    1 times
    Blog Entries
    1
    Quote Originally Posted by Cagatayh View Post
    Hi,
    I used this code but there is a issue. I have a subdomain so when i put the code, if i want to enter the subdomain, there is a problem.

    How can i use this code only for my main site ?
    For instance:

    www.mysite.com
    subdomain.mysite.com

    I only want to apply this code for my main site. if the url is subdomain.mysite.com the code musn't do something.

    Thanks
    Yes you can apply the code only in your main site
    Please add this code in your site root
    Code:
    RewriteCond %{HTTP_HOST} !^www\.domain\.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    Change domain.com to your site URL

  14. #104
    Senior Member
    Real Name
    Cagatayh
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    158
    Liked
    1 times
    Quote Originally Posted by marco1 View Post
    Yes you can apply the code only in your main site
    Please add this code in your site root
    Code:
    RewriteCond %{HTTP_HOST} !^www\.domain\.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    Change domain.com to your site URL
    Thanks i used to use this code. But when i put it into the ftp, subdomain url is changing to http://www.domain.com/subdomain_name

    I want to make it: subdomain_name.domain.com

  15. #105
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,782
    Liked
    648 times
    Blog Entries
    2
    If you are using a subdomain, you need to use different code in the subdomain folder. The root url (www.domain.com) should use the above code.

    and in the subdomain folder, use this in your htaccess:

    RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com
    RewriteRule (.*) http://subdomain.domain.com/$1 [L,R=301]
    Brian Cummiskey / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Page 7 of 18 FirstFirst 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 LastLast

Similar Threads

  1. Urgent help with htaccess and 301 redirects
    By markbolyard in forum URL Rewrite Settings
    Replies: 4
    Last Post: 12-02-2007, 05:24 PM
  2. htaccess redirects when moving folder
    By I, Brian in forum Troubleshooting
    Replies: 3
    Last Post: 10-05-2007, 02:47 PM
  3. Help with initial htaccess setup
    By mhc1576 in forum URL Rewrite Settings
    Replies: 1
    Last Post: 12-28-2006, 07:44 AM
  4. Replies: 6
    Last Post: 10-23-2005, 01:32 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
  •