iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-22-2007, 12:11 PM
WebProWorld Pro
 
Join Date: Jun 2004
Location: CA
Posts: 119
ergobob RepRank 1
Default 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
Reply With Quote
  #2 (permalink)  
Old 06-22-2007, 05:47 PM
WebProWorld New Member
 
Join Date: Dec 2004
Location: Near St. Louis, MO
Posts: 2
bobettekyle RepRank 0
Default 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]
Reply With Quote
  #3 (permalink)  
Old 06-22-2007, 06:27 PM
WebProWorld Pro
 
Join Date: Jun 2004
Location: CA
Posts: 119
ergobob RepRank 1
Default 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
Reply With Quote
  #4 (permalink)  
Old 06-22-2007, 07:23 PM
WebProWorld Member
 
Join Date: Jan 2006
Location: Sydney Australia
Posts: 60
Christiaan RepRank 1
Default 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.
Reply With Quote
  #5 (permalink)  
Old 06-22-2007, 08:38 PM
WebProWorld Pro
 
Join Date: Jun 2004
Location: CA
Posts: 119
ergobob RepRank 1
Default 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
Reply With Quote
  #6 (permalink)  
Old 06-22-2007, 08:59 PM
Keimos's Avatar
WebProWorld Veteran
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 477
Keimos RepRank 0
Default 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 - Always learning something new each day
www.keimos.co.uk , www.keimos.net , www.selfpacedit.co.uk
Reply With Quote
  #7 (permalink)  
Old 06-25-2007, 01:05 AM
mccreath's Avatar
WebProWorld New Member
 
Join Date: May 2004
Location: Australia
Posts: 19
mccreath RepRank 0
Default 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.
__________________
Tony McCreath
Motown - Nexus
http://www.grunt.tv/
Reply With Quote
  #8 (permalink)  
Old 06-25-2007, 08:05 AM
WebProWorld New Member
 
Join Date: Jun 2007
Posts: 3
aden RepRank 0
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 .
Reply With Quote
  #9 (permalink)  
Old 06-25-2007, 10:22 AM
SemAdvance's Avatar
WebProWorld Veteran
 
Join Date: Dec 2005
Location: In Your Mind
Posts: 788
SemAdvance RepRank 3SemAdvance RepRank 3SemAdvance RepRank 3
Default 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
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
301 or 302 redirect? stephanjaeger Search Engine Optimization Forum 9 02-28-2007 09:03 AM
Redirect url bronks Search Engine Optimization Forum 4 06-10-2006 12:18 AM
301 redirect schmeetz Web Programming Discussion Forum 11 08-10-2005 02:54 PM
301 redirect magnolia1 Google Discussion Forum 8 01-17-2005 07:57 PM
To redirect or not to redirect LoveNotWar Search Engine Optimization Forum 1 08-22-2004 08:20 AM


All times are GMT -4. The time now is 09:03 PM.



Search Engine Optimization by vBSEO 3.3.0