Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Apr 05, 2011 8:50 pm 
Offline
Newbie

Joined: Sun Mar 27, 2011 12:00 am
Posts: 2
Website: http://danoc.me/
Hey Guys,

I know that this shouldn't be too hard to do, but the problem is that I have a WordPress in a folder, not the root domain. I have my .htaccess file all set up in the root folder, but not for the WordPress folder.

I wanted to know how to redirect:

- www to non-www
- site.com/guide/ to newsite.com/guide/
- and site.com/guide/some-article/ to newsite.com/guide/some-article/

I was playing around with things, but site.com/guide/some-article/ was redirecting me to newsite.com/some-article/, not newsite.com/guide/some-article/. I would post the code here, but I got rid of it and saved the changes.

The www to non-www seems to be working with this snippet:

Code:
    
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]


Thanks for the help!


Top
   
 Post subject:
PostPosted: Thu Apr 07, 2011 1:42 pm 
Offline
Senior Newbie

Joined: Thu May 07, 2009 6:13 am
Posts: 18
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} site\.com
RewriteRule ^/(.*) http://newsite.com/$1 [R=301,QSA,L]


Untested, but it should work.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group