- Total Members: 263,746
- Threads: 453,996
- Posts: 1,062,371
Great community. Great ideas.
Welcome to SEOChat, a community dedicated to helping beginners and professionals alike in improving their Search Engine Optimization knowledge. Sign up today to gain access to the combined insight of tens of thousands of members.
-
Feb 23rd, 2012, 03:51 AM
#1
SEO Friendly URL Redirect
Hi guys,
I have a question if anyone can help me.
So we have purchased a dropped domain with a PageRank of 4 and we want to retain the sites PageRank but we plan on installing WordPress then adding relevant content and links to another site.
To make sure that the PageRank is kept I need to write a 301 redirect that will redirect any url (whether it exists of not) back to the home page of that site.
For example:
example.com/pages/page.htm ---> example.com
sub.example.com/page.htm ---> example.com
error.example.com/error ---> example.com
I have tried many different types of 301 but most seem to make the site go into an endless loop.
Can anyone help me?
Thanks,
-
Feb 23rd, 2012, 04:45 PM
#2
RewriteEngine On
RewriteRule ^whateverdirectory.*$ http://yoursite.co.uk [R=301,L]
RewriteCond %{HTTP_HOST} !^yoursite\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://yoursite.co.uk/$1 [R=301,L]
this is what I use. This will also forward to non-www. Who needs www these days?.
-
Feb 24th, 2012, 03:38 AM
#3
I just tried that code but i get an error -
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
The redirect is just in a loop, is there anyway to stop this?
-
Feb 24th, 2012, 03:54 AM
#4
Don't you have Linux server ?? Did you enabled Apache Mod-Rewrite ?
Have you tried PHP redirecting ??
Learning Is My Passion
-
Feb 24th, 2012, 03:57 AM
#5

Originally Posted by
imlearner
Don't you have Linux server ?? Did you enabled Apache Mod-Rewrite ?
Have you tried PHP redirecting ??
Yes it is on a Linux server, no I haven't tried php redirecting is this an easier way?
-
Feb 24th, 2012, 05:32 AM
#6

Originally Posted by
seokid123
Yes it is on a Linux server, no I haven't tried php redirecting is this an easier way?
If you show me your whole .htaccess file, I will fix the problem for you.
-
Feb 24th, 2012, 05:52 AM
#7

Originally Posted by
zico82
If you show me your whole .htaccess file, I will fix the problem for you.
Thanks alot,
Here is the access file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
-
Feb 24th, 2012, 06:19 AM
#8

Originally Posted by
seokid123
Thanks alot,
Here is the access file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Try this. Edit somedir and http://yourwordpresssiteurl.com/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^somedir.*$ http://yourwordpresssiteurl.com/ [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
If you get another prob let me know. But that should work. Just tried it on one of our WP sites with a non existent directory and all was fine.
-
Feb 24th, 2012, 08:54 AM
#9
I tried that code but it doesn't seem to have done anything. The website just works as it normally would.
-
Feb 24th, 2012, 09:08 AM
#10

Originally Posted by
seokid123
I tried that code but it doesn't seem to have done anything. The website just works as it normally would.
Sorry I am at a loss.
It works, I know it does.
-
Feb 24th, 2012, 10:02 AM
#11
Ah, I've tried it on a different WordPress site we own with a different host and its worked. I think it must be something to do with the server....
Thanks for your help!
-
Feb 24th, 2012, 04:43 PM
#12

Originally Posted by
seokid123
Ah, I've tried it on a different WordPress site we own with a different host and its worked. I think it must be something to do with the server....
Thanks for your help!
No problems, glad to be of help.
-
Mar 2nd, 2012, 07:26 AM
#13
url rewrite
can i help me..
what is rewrite url..
technic.
-
Mar 2nd, 2012, 07:29 AM
#14
url rewrite
i guys.
pls help me ..
what is url rewrite technic..
Similar Threads
-
By chintansoni in forum Google Optimization
Replies: 3
Last Post: Mar 4th, 2006, 01:18 PM
-
By zigzag in forum Google Optimization
Replies: 6
Last Post: Dec 3rd, 2005, 02:32 PM
-
By earn100 in forum Search Engine Optimization
Replies: 10
Last Post: Nov 14th, 2005, 12:44 PM
-
By ChillnVilln in forum Web Design, Coding and Programming
Replies: 4
Last Post: Aug 31st, 2004, 10:57 AM
-
By relaxzoolander in forum Google Optimization
Replies: 24
Last Post: Oct 4th, 2003, 08:00 AM
Comments on this post