Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I need to redirect to I have used mod_rewrite a few times, is it possible to solve this in a similar way?

share|improve this question
Make sure you use a technique that returns a 301 Permanent Redirect as I might cause browsers to update their bookmarks! – Max Ried Mar 24 '14 at 8:48
But as noted in comments (below): " doesn't exist anymore." – w3d May 1 '14 at 13:48

4 Answers 4

Below is the code you can use in .htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$$1 [P]
share|improve this answer

On create .htaccess file (where site/ is):

RewriteEngine on
RewriteRule  (.*)$1  [P,L] 

With this when you go to the site will proxy to

share|improve this answer
I can't create .htaccess file on The site doesn't exist anymore. Just – user37194 Mar 23 '14 at 15:03

This might do what you are looking for:

RewriteEngine on
RewriteCond %{SERVER_PORT} ^81$   # check if port 81
RewriteCond %{REQUEST_URI} ^site/ # check if it starts with "site/"
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

[R=301,L] if you want permanent redirect (the :81 taken out of SEO results for example).
Im not really sure if you have to add :80 after the %{SERVER_NAME}, please let me know so I can update the answer.

share|improve this answer

You need to have a web server running at, and create a .htaccess file there.

share|improve this answer

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.