![]() | | ||||||||
| | #1 |
| Buy @ DomainShoe.com War Room Member Join Date: Mar 2008 Location: Texas, United States
Posts: 89
Blog Entries: 6 Thanks: 28
Thanked 4 Times in 4 Posts
|
I'm able to redirect for the main page using this code: RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com RewriteRule (.*) http://www.domain.com/$1 [R=301,L] However, the same conditions don't apply for a subfolder as I can't get http://domain.com/blog to redirect to http://www.domain.com/blog. Anyone know how to redirect for this subfolder? Thank You. |
| DomainShoe.com = $7.49 .nets, $6.99 .orgs, $1.95 privacy. Free whois privacy with purchase of 5 domains. Make Money Reselling Domains | |
| | |
| | #2 |
| Senior Warrior Member War Room Member Join Date: Apr 2006 Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
|
Change your code to this: Code: RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] Steve |
| Executive I.T. consulting for small/medium business Website development | PHP - MySQL - JavaScript expert programming Software requirements analysis | Specification writing Project management | Vendor relationship management | |
| | |
| | #3 |
| Buy @ DomainShoe.com War Room Member Join Date: Mar 2008 Location: Texas, United States
Posts: 89
Blog Entries: 6 Thanks: 28
Thanked 4 Times in 4 Posts
|
Thank you very much, Steve. That did work for me. Do you know the code for a regular URL redirect on WP? |
| DomainShoe.com = $7.49 .nets, $6.99 .orgs, $1.95 privacy. Free whois privacy with purchase of 5 domains. Make Money Reselling Domains | |
| | |
| | #4 |
| Senior Warrior Member War Room Member Join Date: Apr 2006 Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
| |
| Executive I.T. consulting for small/medium business Website development | PHP - MySQL - JavaScript expert programming Software requirements analysis | Specification writing Project management | Vendor relationship management | |
| | |
| | #5 | |
| Buy @ DomainShoe.com War Room Member Join Date: Mar 2008 Location: Texas, United States
Posts: 89
Blog Entries: 6 Thanks: 28
Thanked 4 Times in 4 Posts
| Quote:
Example: redirecting http:// wordpressblog.com to http:// www.wordpressblog .com. Inserting a .htaccess doesn't do the trick in a WP blog for me. | |
| DomainShoe.com = $7.49 .nets, $6.99 .orgs, $1.95 privacy. Free whois privacy with purchase of 5 domains. Make Money Reselling Domains | ||
| | |
| | #6 |
| Senior Warrior Member War Room Member Join Date: Apr 2006 Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
|
This should be a complete solution for WordPress. Just make sure that this code comes before the WP-generated code in your .htaccess file. Code: Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] |
| Executive I.T. consulting for small/medium business Website development | PHP - MySQL - JavaScript expert programming Software requirements analysis | Specification writing Project management | Vendor relationship management | |
| | |
![]() |
|
| Tags |
| 301, question, redirect, subfolder |
| Thread Tools | |
| |
![]() |