Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had which I had to turn into Unfortunately, everything was written with the absolute path so its like <a href="/intranet/timeclock">time clock</a>

So you see my dilemma. everything wants to go to like /intranet/timeclock

I tried some rewrite rules like

    RewriteRule ^/intranet / [R,L]
    RewriteRule ^/intranet/(*.) /$1 [R,L]

And others. No luck. I have looked at the other posts on server fault and tried some of them with no luck either. Andy advice?

share|improve this question
Can you, please, clearly describe what you want to rewrite: from => to. Do you want to rewrite into ... or? – LazyOne Jul 13 '11 at 21:25
I would like ""; to rewrite to ""; – hforbess Jul 14 '11 at 12:36
MrTuttle already gave an answer (301 Permanent Redirect). If you place his rule into Apache config file (inside <VirtualHost>, for example) it should work fine. If you are going to place it into .htaccess file, then you should remove leading slash /. The same goes for your own rules -- in .htaccess there is no leading slash when pattern is applied to URL in RewriteRule. – LazyOne Jul 14 '11 at 12:42
up vote 1 down vote accepted

RewriteEngine On

RewriteRule ^/intranet/(.*)$$1 [R=301,L]

share|improve this answer
thats seems like it would work but it does nothing. Am i doing something wrong with the .htaccess file i wonder? – hforbess Jul 14 '11 at 12:46
Thats it! only its RewriteRule ^intranet/(.*)$$1 [R=301,L] – hforbess Jul 14 '11 at 12:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.