Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

my website is stored on server in directory /

on my development machine is stored in directory /mysite

problem is that all links are related to root directory name (ie. /images/contact.html), and they can not be valid on my local server.

can you tell me which .htaccess directive is required, to make enable links on my local server?

thank you in advance!

share|improve this question
up vote 1 down vote accepted

You could try using:

RewriteEngine On
RewriteBase   /mysite

which would make it the root if I understood it correctly.

But i am not sure if that is only after the rules or as a global change.

Otherwise you could try:

RewriteEngine On
RewriteRule ^(.*) mysite/$1 [L]
share|improve this answer
tnx! but what about css files that are included in html source? is it possible to rewrite all kind of links (images, css, js) with this rule? – user48058 Oct 11 '10 at 14:17
not sure about css files but i guess it would, try it :) it won't hurt. – Prix Oct 11 '10 at 14:22
i tried of course, that's why i'm askin :) – user48058 Oct 11 '10 at 14:32
if you had tried you would know the answer, unhappyly like i said i am not sure (since i never used it for that porpouse but in theory it should work) and currently i don't have any place to test it for you to tell you. – Prix Oct 12 '10 at 0:24

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.