0

Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?

How do I substitute http://mydomain.com/dir1/dir2/test.php for http://mydomain.com/test.php?

1
  • It would help to mention platform/webserver. I'm guessing at a flavour of Apache with the mod_rewrite module. Feb 10, 2011 at 16:00

1 Answer 1

0

It would help to mention platform/webserver. I'm guessing at a flavour of Apache with the mod_rewrite module.

If everything is under this new subdir, redirect root ie.

RewriteEngine on

RewriteRule ^/$ /dir1/dir2/ [R]

or if you want ot explicit about a single file.

RewriteEngine on

RewriteRule ^/test.php /dir1/dir2/test.php [R]

M.

Not the answer you're looking for? Browse other questions tagged .