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.site.com/folder1/page.php
Now I want to rewrite the url to (for example)
www.site.com/apple/page.php
The folder1 is an existing folder on my webspace.
important: the "apple" is not a folder rather just a name!
Ok here is a step by step plan:
- User types
www.site.com/folder1/login.php
- The url should rewrite and not redirect the url to
www.site.com/apple/login.php
This means that apple
is just a name and not a directory. All the code should just come from folder1. Acutally apple should just be an alias for folder1
. I can't just rename folder1
to Apple
. Therefor I would just rewrite folder1
to apple
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…