Forum Moderators: phranque
That has a subfolder: www.example.com/classifieds/
That she wants to navigate to the root and it display the subfolder. So if they go to www.example.com it goes to the content in the /classifieds/ directory.
NOT a redirect though. We want to hide /classifieds/
Is this possible by modifying the htaccess or doing so through the admin section?
I have a VERY general knowledge of the htaccess files and mod_rewrites, but do understand how they work.
Thanks in advance for any help!
[edited by: jdMorgan at 3:46 pm (utc) on Oct. 20, 2007]
[edit reason] example.com [/edit]
You also need a redirect such that should someone request the folder at all, they are immediately sent to the shorter URL. failure to have the extra redirect leaves your site open to be indexed under two different URLs and that is bad news.
Both the rewrite and redirct code gets posted here several times every week. There are hundreds of prior examples.
Post your trial code here and a description of how it fails.
On the right you need to specify just an internal filepath if you are doing a rewrite, or a full URL (including http and domain) if you are doing a redirect.
You'll need a RewriteCond before that to check the %{HTTP_HOST} is the correct domain. Think carefully as to whether the rules work only for www or for non-www or for both. You need to avoid Duplicate Content issues.
Yes. You need a rewrite from A to B and a redirect from B to A. Only URL A can then ever be indexed.