I have www.example.com,my main site is in www.example.com/main First I want to do is to redirect from root(www.example.com) to www.example.com/main,than I want to rewrite url(www.example.com/main) to became www.examle.com Is this posible?Any help will be great.

Also I would like,if user click on the link info,he will go to(www.example.com/info) I would like to rewrite url to(info.example.com)

Tnx

link|improve this question
feedback

1 Answer

In the VirtualHost config for www.example.com:

RewriteEngine on

RewriteRule ^/$ /main [R=301,L]
RewriteRule ^/info$ http://info.example.com [R=301,L]
link|improve this answer
Sorry,it does not work for me,I'm doing something wrong.I create .htaccess file,copy you code,and put it in to root dir.Just to make a note,I'm trying this on my website,not on localhost.Thx for response. – user41117 Oct 23 '10 at 6:22
feedback

Your Answer

 
or
required, but never shown

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