- This topic is empty.
-
AuthorPosts
-
June 17, 2005 at 2:54 pm #588953AnonymousInactive
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=1Could 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,
BernieJune 17, 2005 at 11:02 pm #667227AnonymousInactiveusing 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
June 26, 2005 at 2:17 am #667613AnonymousInactiveThanks DivaG
That worked perfectly for the redirecting the non-www to the www, but how do I get these files:
http://www.mysite.com/index.php
http://www.mysite.com/index.php?page=1to simply redirect to:
?
Best regards,
BernieJuly 1, 2005 at 3:43 am #667921AnonymousInactiveI am still very interested in knowing the answer to this if anyone knows… again my prediciment is that I have several pages that are the same page, and I would like them to redirect to the ONE correct page.
they are:
index.php
index.php?page=1I would like these to re-direct to my “www.sitename.com” page
Can anyone help me do this through .htaccess?
also I have a few pages like blackhawk.htm that are PR6 and I need to redirect them to a different page – 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?
thanks much
Any help with these technical problems appreciate.Thanks,Bernie
July 1, 2005 at 6:11 am #667925AnonymousInactiveis 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”);
exit();
?>[/HTML]Make sure there aren’t any spaces before the and after 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?
July 1, 2005 at 5:29 pm #667953AnonymousInactiveThanks Dave,
I have done this and it works for redirecting.
Best regards,
Bernieedited to remove stupid question
July 1, 2005 at 7:52 pm #667961AnonymousInactiveblackhawk 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?July 3, 2005 at 2:51 pm #668028AnonymousInactiveQuote: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,
BernieJuly 14, 2005 at 4:59 pm #668642AnonymousInactiveYou 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 NotesJuly 14, 2005 at 5:16 pm #668645AnonymousInactiveThank you, Ginette! I hope you are well!
July 17, 2005 at 9:06 am #668836AnonymousInactivehttp://www.google.com/remove.html#exclude_pages
To remove dynamically generated pages, you’d use this robots.txt entry:
User-agent: Googlebot
Disallow: /*?July 28, 2005 at 7:24 am #669381AnonymousInactiveDang, 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!
July 28, 2005 at 10:08 am #669384AnonymousInactiveJuly 28, 2005 at 5:45 pm #669400AnonymousInactivethanks 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.htmlthis 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? — 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?
July 28, 2005 at 9:24 pm #669408AnonymousInactiveHow about 301 Redirect?
http://www.webconfs.com/how-to-redirect-a-webpage.php -
AuthorPosts