Debt Consolidation - Bob's Free Stuff Forum - Watch Naruto Online - Health 2007 - Debt Consolidation

PDA

View Full Version : www VS http://


zibzer
Mar 19th 2006, 6:46 am
hello,

i have a website that gets all its link from http://largemouthbasstips.com

but yahoo only has http://www.largemouthbasstips.com

does this matter? if so how would i 301 the www domain to the http domain? thanks!

Old Welsh Guy
Mar 19th 2006, 6:51 am
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain\.com
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent,L]


That'll do it for you.

Or reverse it if you want the 301 to go the other route.

clancey
Mar 19th 2006, 6:53 am
Both forms of the URL reach your page. As long as this is true it does not matter and you do not need to do any redirects.

Putting the "www." before the domain is the conventional way of expressing a URL. In recent years, more people have opted not to do so. However, disallowing its use is not a good idea, because many people put "www." before the domain name in a URL when typing it out by hand. If it does not work, they will not get the problem.

Old Welsh Guy
Mar 19th 2006, 6:57 am
Clancey, sorry but your wrong. Until Google sort out their canonical issues, it will treat
www.domain
domain.
www.domain.com/index.php
domain.com/index.php

All as different pages and domains. As such, it will split your lihnk benefit across all those pages. This is why you should link to one set format ie www.domain.com or domain.com. Never hard code it to domain.com/index.htm as .htm .html .php .asp .cfm etc are all different pages in the eyes of the search engines.

The ideal way to handle it is with local bind DNS at server level, but this is not always possible with certain hosting companies, and so a 301 is the only safeguard

zibzer
Mar 19th 2006, 7:20 am
the code gave a 500 error.

can i get a code that:

redirects
www.largemouthbasstips.com
TO
largemouthbasstips.com

thank you for your help!

zibzer
Mar 19th 2006, 7:21 am
or what would u recomend
?

zibzer
Mar 19th 2006, 7:34 am
ok i got it to somewhat work

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

but now it redirects to

http://www.largemouthbasstips.com/index.php

is there a way to simply redirect it to

http://www.largemouthbasstips.com/ and NOT the index.php

Old Welsh Guy
Mar 19th 2006, 11:54 am
The index.php is the default page that is being directed. If you put a .htm, or .html page there it would default to that as well The displaying of the /index.php page is handled by the server software, and will not affect the forwarding. The way you have done it is quite right.

mad4
Mar 19th 2006, 12:59 pm
I use the following to redirect from www.domain.com/index.php3 to www.domain.com and http://domain.com to www.domain.com

RewriteCond %{HTTP_HOST} ^pyramidlinking.com
RewriteRule (.*) http://www.pyramidlinking.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php3\ HTTP/
RewriteRule ^index\.php3$ http://www.pyramidlinking.com/ [R=301,L]

Old Welsh Guy why do you not suggest this? I thought it was always needed?

Old Welsh Guy
Mar 19th 2006, 1:12 pm
No reason,
I have never used that as I have always used the other, and found it to work well.

zibzer
Mar 19th 2006, 3:02 pm
i realise what the index page does. its just im not sure if the search engines would see both

www.largemouthbasstips.com

AND

www.largemouthbasstips.com/index.php

and split the PR between the 2 pages and possibly penalize me for duplicate content

zibzer
Mar 19th 2006, 3:17 pm
mad4. when i use your code it says i have a redirection problem and it is a continuous loop

mad4
Mar 19th 2006, 3:21 pm
hmmm, I cut & pasted right out of my working code.

Have you put it in exactly the same order that I posted? Are there any other things in the htaccess file?

zibzer
Mar 19th 2006, 3:30 pm
if i put it in EXACTLY as you say substituting your domain for mine and substituting php3 to php it does not work at all.. no redirections take place

RewriteCond %{HTTP_HOST} ^largemouthbasstips.com
RewriteRule (.*) http://www.largemouthbasstips.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.largemouthbasstips.com/ [R=301,L]

if i add

RewriteEngine On

so it looks like this

RewriteEngine On
RewriteCond %{HTTP_HOST} ^largemouthbasstips.com
RewriteRule (.*) http://www.largemouthbasstips.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.largemouthbasstips.com/ [R=301,L]

then i get the following error

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

zibzer
Mar 19th 2006, 3:31 pm
and there is no other scripts in the HTACCESS file

mad4
Mar 19th 2006, 3:35 pm
Sorry, if that doesn't work I can't help more. The following is my entire htaccess file for the pyramidlinking.com site which works fine :confused:

ErrorDocument 404 http://www.pyramidlinking.com/404.php3
RewriteEngine on
RewriteCond %{HTTP_HOST} ^pyramidlinking.com
RewriteRule (.*) http://www.pyramidlinking.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php3\ HTTP/
RewriteRule ^index\.php3$ http://www.pyramidlinking.com/ [R=301,L]

zibzer
Mar 19th 2006, 3:41 pm
thanks anyways for your help. i think i might call my hosting service and see why this isnt working

zibzer
Mar 19th 2006, 4:13 pm
well i managed to get around it by using

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

notice there is not /$1

now the only problem this causes is if you enter for example http://largemouthbasstips.com/articles.htm you get redirected to

www.largemouthbasstips.com


i will leave these rules and keep an eye on my raw data to se eif it causes any conflicts. thank you for all your help! and if you want to add something PLEASE DO :D

sagetips
Mar 19th 2006, 4:47 pm
Zibzer-

I still see a separate page at http://www.largemouthbasstips.com/index.php.

I too am trying to figure out how to redirect http://www.example.com/index.php. to http://www.example.com/. Mad4's code didn't work for me either.

Everything else seems to redirect the way I want it with:

Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent]

CReed
Mar 19th 2006, 8:57 pm
can i get a code that:

redirects
www.largemouthbasstips.com
TO
largemouthbasstips.com

thank you for your help!

Try:

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

sagetips
Mar 20th 2006, 2:39 pm
then i get the following error

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

For what it's worth...I originally had this same issue but decided to try mad4's code again...and it worked great this time! The first time I tried it I was in Firefox and the second time I was in IE. Perhaps there's an issue with Firefox caching or something.

Anyway, thanks for sharing mad4.