Get exclusive CAP network offers from top brands

View CAP Offers

google and Redirects

blackhawk asked 3 years ago
Ok, there was a thread – sorry I couldn’t find it – about 301 redirects to insure that your home page PR is not split. Basically this is the

http://www.yoursite.com vs yoursite.com (no www)

I have a few questions about this, on my site all of the following are the same page:

http://www.yoursite.com
yoursite.com
yoursite.com/index.php
yoursite.com/index.php?page=1

Could this potentially mean that my PR could get divided by FOUR instead of TWO? and if so, can someone help me with an .htaccess file that will make everything direct to the http://www.yoursite.com ?

Best regards,
Bernie

22 Answers
blackhawk answered 3 years ago
thanks VD — and I have looked at that voodoo for some time and gone crosseyed.

can you clear this up for me. when I think of mod-rewrite I think of this thing some programmers did for me that turns pages like:

xwww.gamblingforum.com/forum/viewtopic.php?posid=32&SESSION=3243242
to something more readable like this
xwww.gamblingforum.com/forum/post2.html

this is not what I’m doing here…. I am actually trying to redirect to a new page that is completely different page. (not the same page rewritten)

do I still look where the link points me? <span title=” title=”” class=”bbcode_smiley” /> — sorry, if I look at that for four hours and find out it doesn’t work, I’ll be sad … can you shed just a wee bit more light?

DivaG answered 3 years ago
using mod rewrite so all links contain the www version this code is placed in your htaccess file Not all servers/hosts allow you to use mod rewrite:

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

OR simply add this line which tells anyone grabbing the other page it has moved permanently to the http://www.yoursite.com

redirect 301 yoursite.com http://www.yoursite.com

blackhawk answered 3 years ago
Dang, guys.

Still having trouble with this can someone give me an idiots example of how to redirect this file:

index.cfm?var_file=cripcdir.htm

to this file:

cripple.php

Thanks much in advance!

vd752 answered 3 years ago
http://www.google.com/remove.html#exclude_pages

To remove dynamically generated pages, you’d use this robots.txt entry:

User-agent: Googlebot
Disallow: /*?

Dominique answered 3 years ago
Thank you, Ginette! I hope you are well!

DivaG answered 3 years ago
You can use htaccess or mod rewrites to force a page to equal a specific page. You can point any virtual page name or long dynamic page url to a simplified version which is actually virtual.

AS long as it is a permanent redirect – 301
AND you are NOT trying to link stuff by having the virtual links like this domain.com?page=2 domain.com?page=3 in your pages there should not be a looping problem for users or bots.

There are cleaner ways do do this at the server level but it depends on your server flavor and what you want to accomplish.

additional resources:
CAP Spring Break Notes

blackhawk answered 3 years ago
Quote:
Great! Did you end up using .htaccess to make index.php and index.php?page=1 redirect to xwww.yoursite.com?

No that part I didn’t figure out yet… Was talking about redirecting:

Quote:
If you use .htaccess or a 301 Permanent Redirect, 100% of the PR should be transferred (and yes, it’s seamless). A 301 Permanent Redirect is quite easy to use — after you move the old page to the new URL, delete all of the code on the old page and replace it with this:

Now I really have to figure out the other trick. I have php files that include .htm files…. both are ranking in the engines – but when the .htm files show up, there is no CSS style sheets,etc… applied because it is just pulling the guts of the page. How to make someone who calls thispage.htm, load thispage.php?

Thanks,
Bernie

Engineer answered 3 years ago
blackhawk wrote:
I have done this and it works for redirecting.

Great! Did you end up using .htaccess to make index.php and index.php?page=1 redirect to xwww.yoursite.com?

blackhawk answered 3 years ago
Thanks Dave,

I have done this and it works for redirecting.

Best regards,
Bernie

edited to remove stupid question

Engineer answered 3 years ago

is it best to put a link on the PR6 page to pass the PR? or will another redirect through .htaccess accomplish the same thing seamlessly?

If you use .htaccess or a 301 Permanent Redirect, 100% of the PR should be transferred (and yes, it’s seamless). A 301 Permanent Redirect is quite easy to use — after you move the old page to the new URL, delete all of the code on the old page and replace it with this:

[HTML] header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: http://www.yoursite.com/newpage.php&#8221;);
exit();
?>[/HTML]Make sure there aren’t any spaces before the . Hold down the delete key to make sure there aren’t any hard returns or spaces, otherwise the redirect may not work right.

I don’t think you could use a 301 redirect on index.php or index.php?page=1, since these pages are the same as the home page of http://www.yoursite.com. I don’t know what would happen if you redirected a page to itself — I guess it would create an infinite loop.

I am not very familiar with .htaccess, but I do believe some kind of .htaccess code will end up being the solution here. I know it is possible to use .htaccess to rewrite URLs so that the “?” in the URL is replaced with a forward slash (some people do this for SEO reasons). You can also shorten dynamic URLs this way. Here is a page that might give you a few ideas.

Does anyone else have ideas on how to solve this problem?