WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my current .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) /directory/ [R=301,L]

And "directory" is where my wordpress install is. So this simply redirects people from the root domain to the directory.

What I would like to do is create it so any information added to the url is passed through when the directory is added. SO http://yoursite.tld/page becomes http://yoursite.tld/directory/page/

I know this is probably a snap for someone with more experience with regular expressions. Unfortunately I haven't been able to track down the info with standard web searches. Appreciate the help...

share|improve this question
up vote 1 down vote accepted
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) /directory/$1 [R=301,L]

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule look at "backreferencing"

share|improve this answer
Fantastic, thank you. 2 characters... I feel foolish and grateful. – SteveLambert Mar 26 '12 at 5:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.