0

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...

1 Answer 1

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

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

1
  • Fantastic, thank you. 2 characters... I feel foolish and grateful. Mar 26, 2012 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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