Here's a problem I'm always wanting to solve with htaccess. I haven't found a way yet, though it looks like it should be possible - perhaps someone can help.
Let's say I have a folder at the root of my site called
. I want users to be able to access that folder at the path
, but for various reasons I can't rename the folder.
So as not to create confusion I only want one path to ever be seen - that is to say, I <em>don't</em> want people to use the name
to access the folder; they should always use
. If someone goes to
, their browser should redirect to
- but the content returned should be the content of
.
To make matters more complicated, pages in
have dependencies (images, stylesheets, links to other pages, etc) within
which are hardcoded and can't be changed. These must, of course, still work.
So, to summarise, this is what I want :
<ul>
<li>Requests for
should redirect to
.</li>
<li>Requests for
should return the contents of
.</li>
</ul>
Is this possible? It looks on the surface as if it would create an infinite redirect... but I'm pretty sure there are ways to prevent that in htaccess, aren't there?
I'd be very grateful for any help.
(PS - for a little extra background: The normal reason I want to do this is to rename the wordpress
directory to something more professional and easy for customers to remember, such as
. But the same system should work for masking any path in this way.)
Let's say I have a folder at the root of my site called
Code:
/foo/
Code:
/bar/
So as not to create confusion I only want one path to ever be seen - that is to say, I <em>don't</em> want people to use the name
Code:
/foo/
Code:
/bar/
Code:
example.com/foo/
Code:
example.com/bar/
Code:
/foo/
To make matters more complicated, pages in
Code:
/foo/
Code:
/foo/
So, to summarise, this is what I want :
<ul>
<li>Requests for
Code:
example.com/foo/
Code:
example.com/bar/
<li>Requests for
Code:
example.com/bar/
Code:
example.com/foo/
</ul>
Is this possible? It looks on the surface as if it would create an infinite redirect... but I'm pretty sure there are ways to prevent that in htaccess, aren't there?
I'd be very grateful for any help.
(PS - for a little extra background: The normal reason I want to do this is to rename the wordpress
Code:
/wp-admin/
Code:
/admin/