[+] Post Title :
[+] Date : Selasa, 04 Oktober 2011
[+] Author : Dr. Cruzz
[+] Link : http://xcruzz.blogspot.com/2011/10/301-redirect-examples.html
[+] Type : Exploit
Ok now i will share about a Redirect Pages :)301 Redirect Examples
[+] Date : Selasa, 04 Oktober 2011
[+] Author : Dr. Cruzz
[+] Link : http://xcruzz.blogspot.com/2011/10/301-redirect-examples.html
[+] Type : Exploit
Ok lets begin :)
To Move a single page
Quick, easy and seamless for your visitors.
1 | Redirect 301 /oldpage.html http: //www.example.com/newpage.html |
This will catch any traffic on your old site and redirect it to your index page on your new server. If you want to redirect each page to its new spot, this isn’t the one for you.
1 | Redirect 301 / http: //www.example.com/ |
This example is perfect if you’ve decided to switch to .php from .html pages. It will look for any .html page and redirect it to .php (ie http://www.example.com/yourpage.html and redirect it to http://www.example.com/yourpage.php). Now, be careful with this, it does mean any html page. I did this on one of my sites and had totally forgotten I had an iframe with .html content on some pages… I didn’t notice for weeks that it was broken :S.
So learn from my mistake

1 | RedirectMatch 301 (.*)\.html$ http: //www.example.com$1.php |
It’s best to stick with either always using www.example.com or just example.com. Allowing both can confuse the search engines. So here’s how to force your site to always show the non-www version. (Search for “canonical url errors” in your favorite search engine for more info.)
Note: If you do use either of the next 2 codes below, and use a secure server (ie. https:) be sure to check that it doesn’t redirect the secure to the insecure version. I’m pretty sure this will do that and that isn’t something you want!
1 2 3 4 5 | Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^example\.com RewriteRule (.*) http: //example.com/$1 [R=301,L] |
Same as above except in the reverse, this one forces the www. into your url.
1 2 3 4 | Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http: //www.example.com/$1 [L,R=301] |
Another snippet that I’ve heard is a good idea to make sure search engines don’t give you a duplicate content penalty, this will also redirect example.com/folder/index.php to example.com/folder/.
1 2 3 4 5 | Options +FollowSymLinks RewriteEngine on # index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ / $1 [R=301,L] |
Method 2 – PHP Redirect
This works well if your pages are php enabled, simply place this code at the very top of the old file and your visitors will be smoothly sent to the new location.
1 2 3 4 |
I’d really advise against redirecting this way since many search engine have difficulties with this one (and spammers have been known to use this in very bad ways) so it might get your page in a heap of trouble! Some browsers also don’t read it properly so your would-be visitors may get stranded. Seriously, it really isn’t advisable to use this anymore but if you don’t have access to php or an .htaccess file on your host it might be the best (or only) way so here it is.
1 |
enjoy …
./kaMtiEz
0 komentar:
Posting Komentar