views:

6

answers:

0

Hi, this is the first bit of apache rewriting I've done, so hopefully it's an easy one for the experts out there.

I have a website which for this example would have 3 pages:

www.example.com/appname/page1 www.example.com/appname/page2 www.example.com/appname/page3

I want to hide the appname from the person browsing the site for every request.

I have created a rewrite rule that deals with the first request:

RewriteRule ^/(.*)$ http://www.example.com/appname/$1 [R=301]

This allows them to find the site if the browse www.example.com/page1

The problem I have now is it still displays www.example.com/appname/page1 in the browser, can I strip this form the URL so it's never visible in the user? Secondly, the links within the html of the site have to contain the appname, so a link on page1 to page2 will be to www.example.com/appname/page2, I want to again be able to translate this so it's displayed as www.example.com/page2 in the browser once you've navigated to the page

Thanks