| | #1 |
| Ninja Warrior War Room Member Join Date: 2011 Location: asd
Posts: 283
Thanks: 44
Thanked 26 Times in 19 Posts
|
Hello, I've searched all over for a simple answer (and probably missed one) for my problem. I'm trying to redirect a domain, including all sub pages, to a new site. The new site is identical to the old one, except the name and domain name changed. Using my Bluehost cPanel I set up a wildcard 301 redirect from: http://www.oldsite.com to http://www.newsite.com It works. The problem is, my old sub pages and posts are ranking pretty well in search engines, and they are not redirecting. So if someone clicks on... http://www.oldsite.com/post-that-ranks-well ...it doesn't redirect to: http://www.newsite.com/post-that-ranks-well Can anyone help with this? I'd love to figure it out soon so my old site can't be accessed and can be phased out of the SERPs. Thanks, Brock |
| |
| | #2 |
| VIP Warrior Join Date: 2005 Location: Potemkin Village
Posts: 1,724
Thanks: 745
Thanked 742 Times in 498 Posts
|
I'll assume that this site is running on the Apache webserver and that mod_rewrite is enabled... In the root of your web site (public_html folder) create a file called .htaccess if it doesn't exist, or edit it if it does exist (don't forget to create a backup). In your .htaccess file, add a line at the top that reads: redirect 301 / http://www.YourNewDomain.com/That's all. Test to see that it works. |
| |
| | #3 |
| Ninja Warrior War Room Member Join Date: 2011 Location: asd
Posts: 283
Thanks: 44
Thanked 26 Times in 19 Posts
|
Mojo, Thanks. This is a WordPress.org blog hosted on Bluehost, but other than that I have no idea about the backend technical side of things. I already created the redirect, which I'm assuming modified the htcaccess file like you said. The redirect is working, just not for the sub pages. Make sense? -Brock |
| |
| | #4 |
| Ninja Warrior War Room Member Join Date: 2011 Location: asd
Posts: 283
Thanks: 44
Thanked 26 Times in 19 Posts
|
FYI here's what my .htaccess contains: RewriteEngine on # 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 RewriteCond %{HTTP_HOST} ^amazonaffiliatesblog\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.amazonaffiliatesblog\.com$ RewriteRule ^(.*)$ "http\:\/\/www\.brockstarlife\.com\/$1" [R=301,L] |
| |
| | #5 |
| VIP Warrior Join Date: 2005 Location: Potemkin Village
Posts: 1,724
Thanks: 745
Thanked 742 Times in 498 Posts
|
You can do it simply by editing your .htaccess file and adding a line to what you've already got so that your .htaccess file looks like this: RewriteEngine on # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / redirect 301 / http://www.YourNewDomain.com/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteCond %{HTTP_HOST} ^amazonaffiliatesblog\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.amazonaffiliatesblog\.com$ RewriteRule ^(.*)$ "http\:\/\/www\.brockstarlife\.com\/$1" [R=301,L] Or, you could just delete your .htaccess (make a backup) and do what I said earlier and create an .htaccess file with nothing but this line in it: redirect 301 / http://www.yournewdomain.com/ That will redirect everything. |
| |
| | #6 |
| Ninja Warrior War Room Member Join Date: 2011 Location: asd
Posts: 283
Thanks: 44
Thanked 26 Times in 19 Posts
|
Worked perfectly. Thanks very much! Should I delete the Bluehost redirect that I created or does that even matter? Thanks again, Brock |
| |
| The Following User Says Thank You to bmcgoff For This Useful Post: |
| | #7 |
| Warrior Member Join Date: 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi dont redirect with wildcard ! what ? http://upload.seorooz.ir/do.php?imgf=Capture2.png http://upload.seorooz.ir/do.php?imgf=Capture_52bf8.png domain seorooz.ir redirect to domain seorooz.net but posts not redirect !example:seorooz.ir/webdesign . How do I do this too redirects to seorooz.net/webdesign ? I appreciate your help. I’m afraid to fall site RewriteOptions inherit # 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 RewriteCond %{HTTP_HOST} ^seorooz\.ir$ [OR] RewriteCond %{HTTP_HOST} ^www\.seorooz\.ir$ RewriteRule ^/?$ "https\:\/\/seorooz\.net\/" [R=301,L] |
| | |
| |
|
| Bookmarks |
| Tags |
| 301, common, man, redirect, wildcard |
| |