Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.