I've got a website on a FTP, mysite, on which I have :

/index.php which is my real site

/preprod/index.php, which is my pre-production website

I want to make the preprod website visible to any newcomer, but be able to enter a secret URL to access the real site

I've built the following .htaccess :

RewriteEngine on
RewriteRule mysite.com/secret mysite/preprod/index.php [L,R=301]
Redirect /index.php /preprod/index.php

I've got a "404 error"

How could I correct my file ?


Firstly, this belongs on Stackoverflow Secondly, why do you even need any htaccess rules? Just have /index as the pre production site, then put your secret site in a separate folder. Or better still, you could create a subdomain for the secret site

  • Would you be able to answer if I posted it on SO ? – xhaltar Dec 7 '15 at 21:31
  • You will definitely get an answer on SO, but I still don't understand why you are bothering to use htaccess when you could simply just use real directories :) – MyNameWouldGoHere Dec 7 '15 at 22:53
  • Well, you are right, I shouldn't. But I wanna learn how to to this, then I'll decide :) – xhaltar Dec 8 '15 at 8:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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