Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a domain and I would like and visits to the root of the domain only to be forwarded. For example:

www.domain.com -> www.domain.com/holding

However

www.domain.com/home www.domain.com/index.php www.domain.com/*

Will all still go to those locations. I believe this is a .htaccess modification, however I do not know how to do this.

Is anyone able to help?

share|improve this question
    
Why don't you add a simple piece of JS to a html file at domain.com –  HackToHell Apr 18 '13 at 14:13
    
Going to the root will load up index.html first and index.php if there is no HTML. I already have an index.html file there that I require access to, but only want access if the user specifies it in the URL field –  K20GH Apr 18 '13 at 14:22
add comment

2 Answers 2

up vote 1 down vote accepted

Have a look at mod_rewrite's documentation

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* /holding [NC,L,R]
share|improve this answer
add comment

Just add

Redirect / /holding

to you .htaccess or your Apache site configuration.

share|improve this answer
add comment

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.