Forum Moderators: phranque
I'd like to be able to rename a directory using the .htaccess file.
For example, say there's a file as follows:
dir1/hello.html
I'd like it to actually load dir2/hello.html, without the URL changing. The same would apply for all other files in dir1.
Is this possible?
Thanks.
Welcome to WebmasterWorld!
Yes, what you need is an internal rewrite, as opposed to an external redirect.
The resources cited in our charter [webmasterworld.com] will get you started in the right direction.
Jim
RewriteRule ^/dir1(.*)$ /dir2/$1 [R]
RewriteRule [b]^d[/b]ir1[b]/[/b](.*)$ /dir2/$1 [[b]L[/b]]
Options +FollowSymLinksRewriteEngine on