301 Redirect?
- Started
- Last post
- 10 Responses
- hubb7designs
So my website www.pubtel.net and pubtel.net are being seen by Google as two different sites.
I do have the DNS set up properly (so says GoDaddy)
So I'm wondering if I need to use a 301 redirect so that Google will see www.pubtel.net and pubtel.net as the same site.
Any suggestions on how to do this correctly?
- hubb7designs0
So I found that I need to edit the .htacces file on my GoDaddy server in order to complete the 301 redirect. But when I edit the .htaccess file as follows:
AuthType Basic
AuthName "User Backups"
AuthUserFile /home/content/P/T/3/html/stats...
require valid-user
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^pubtel.net [NC]
RewriteRule ^(.*)$ http://www.pubtel.net/$1 [L,R=301]And then I test the redirect on this site:
http://www.stepforth.com/resourc…I still get a result of:
HTTP/1.1 200 OKI believe that I'm suppose to be getting:
HTTP Status Code: HTTP/1.1 301 Moved PermanentlyAnything that I'm missing here?
- acescence0
godaddy caches htaccess files, it deletes the cache every hour so you may not see changes immediately
- hubb7designs0
Thanks acescence... I'll stand by.
Does the .htaccess file look good to you?
- amullins0
this should not be setup as 2 websites. you should have an 'A' record set for each in your dns and www.pubtel.net should be setup as an alias for pubtel.net (or vice-versa) in your apache conf. setup google webmaster tools and choose, under "site configuration", to display urls as either www.pubtel.net or simply pubtel.net.
- acescence0
the redirect looks ok, not sure what you're doing with that auth stuff.
@amullins, it's not two separate sites, it's the non-subdomain and www subdomain resolving to the same directory. solving this with just DNS will result in duplicate content issues, which is what he's trying to avoid here. all doing it via DNS would do is tell the browser to query for the IP using a different hostname, without redirection bots will see them as two separate URLs
- i did mention that one of them would need to setup as an alias of the other, in apache...amullins
- acescence0
they're both already resolving to the same directory, so one is already aliased to the other in apache, that's not the issue. you still need to redirect one to the other on the client side.
- oic the 301 redirect COULD go in the virtualhost configuration, though. i should make sure i have this setup, too :)amullins
- hubb7designs0
@acescence: the Auth stuff was already in the htaccess file, so I figured I would just leave it.
But if it's not even needed I'll delete them suckas!
What do you recommend?
by the way... I really appreciate all the knowledge so far. Thanks a million.
- hubb7designs0
@acescence... still getting the same results HTTP/1.1 200 OK
There must be something that I'm not doing right in order to complete the redirect.
- Do you know a site/tutorial to properly complete a 301 redirect with a Godaddy Linux server?hubb7designs
- acescence0
I assume you're putting the .htaccess file in the root directory of your site?