Thursday, 19 September 2013

Rewrite folder's name using htaccess

Rewrite folder's name using htaccess

I am wondering wether it's possible to use .htaccess to rewrite a folder
name. What I mean is this.
Lets say I have a url like:
www.example.org/anyname/page.php
Now I want to rewrite the url to (for example)
www.example.org/folder1/page.php
The folder1 is an existing folder on my webspace.
important: the "anyname" is not a folder rather just a name!
Ok here is a step by step plan:
User types www.site.com/anyname/login.php. The url should rewrite and not
redirect the url to www.site.com/folder1/login.php This means that
"anyname" is just a name and not a directory. All the code should just
come from folder1. Acutally "anyname" should just be an alias for folder1.
I can't just rename folder1 to "anyname". Therefore I would just rewrite
folder1 to "anyname".

No comments:

Post a Comment