Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.