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?

jim
  • 1

1 Answers1

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.

Michael Henry
  • 577
  • 3
  • 9