|
|
#1
| ||||
| ||||
|
Per Matt Cutts, Google is good at following 301 redirects, and using them to track old url's to new url's. I recommend them when url's are being changed, not just when you are moving to a new webhost. http://www.mattcutts.com/blog/moving-to-a-new-web-host/ Quote:
Last edited by T2DMan; 6th Dec 05 at 12:58 PM. |
|
#2
| ||||
| ||||
|
php code - Without the first line, the redirect becomes the bad 302 redirect If you are doing it via htaccess, have a look at the following thread - for non www to www 301 redirects [PHP] if (PHP_VERSION >= '4.3.0') { header("Location: $url", 0, 301); } else if (SAPI_NAME == 'cgi' OR SAPI_NAME == 'cgi-fcgi') { header("Location: $url"); // Call the status header after Location so we are sure to wipe out the 302 header sent by PHP header('Status: 301 Moved Permanently'); } else { header("Location: $url"); header('HTTP/1.1 301 Moved Permanently'); } [/PHP] |
|
#3
| ||||
| ||||
|
Here is a quick and dirty htaccess to convert underscores to dashes in your url's. Code: #Underscore to dashes
hackRewriteRule ([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ $1-$2-$3-$4-$5.html [R=301,L]
RewriteRule ([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ $1-$2-$3-$4.html [R=301,L]
RewriteRule ([^_]*)_([^_]*)_(.*)\.html$ $1-$2-$3.html [R=301,L]
RewriteRule ([^_]*)_(.*)\.html$ $1-$2.html [R=301,L]
RewriteCond %{REQUEST_URI} ^//
RewriteRule /(.*) $1
|
|
#4
| |||
| |||
|
Thanks for the code. Can you give some information about .htaccess. With regards, Mandar Thosar
__________________ Offshore Software Development Company expertise in Custom Software Development & Outsourced Product Development |
|
#5
| ||||
| ||||
|
I am not giving away links from good pages for such an unspecific request. What is your question, what specific information are you wanting?
|
|
#6
| |||
| |||
|
Thanks for the info-- I have beenlooking for this for some time as I saw many site's PR get divided. I think with 301 redirect helps to concentrate PR value at the same URL. Recently --I did a URL Preference with Google for one of my site. Are these two the same? Sorry --if I am bothering--but I am very ignorant on codes and server management. Regards |
|
#7
| ||||
| ||||
| Quote:
I had a strange instance last week where a client gave the Google preference for non www, yet had an htaccess redirecting to the www version. Now you can see why Google calls it a preference. In that case, it would be likely that either Google got rather confused, or it overrode the preference, and just used the www version. Combining all Google PR and text link votes into one version of the url means you actually get the best. Then you also set the google preference for the same version. Also means you are doing things right for the other search engines as well. |
|
#8
| |||
| |||
|
Thanks again- Actually I have built links without WWW but a bit worried--if other people link it they might unknowingly add WWW. Anyway--I should not rely on others and should build links myself! |
|
#9
| |||
| |||
|
This is the .htaccess file should be in the DocumentRoot directory for your web site. The .htaccess file contains two columns. The first column is what you want redirected and the second column is where you want it redirected to. For example, to redirect an entire web site to another site: Redirect 301 / http://www.example.com/Example Web Page Or, to redirect just one page to another page: Redirect 301 /old-page.shtml http://www.example.com/new-page.shtml Last edited by T2DMan; 25th May 09 at 08:29 AM. |
|
#10
| |||
| |||
|
So google use this technique also i care about this.
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| non www to www 301 redirects | T2DMan | 6 | 29th May 10 06:38 AM | |
| ASP 301 redirects | T2DMan | 1 | 4th Aug 06 01:25 PM | |
| index.php to root redirects | T2DMan | 0 | 1st Jun 06 11:37 AM | |