Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, here is the situation:

We are running a website which is powered by Drupal. Sometime ago, it was decided that the website should be served as SSL. The settings to redirect the site from http to https was done by a guy who is not with us anymore.

I can see in the .htaccess file the following lines

#Redirect http to https
RewriteEngine On  
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$$1 [R,L] points to the root of the LAMPP server and my site is in a folder inside the webroot (

Now, it has been decided that the SSL is not needed and it has to be removed and all the pages must be served via http (301 redirect).

When I do that in the .htaccess file by using the RewriteRule to redirect a URL (e.g. to http when a user visits https by using:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

#Redirect HTTPS to HTTP
RewriteCond %{SERVER_PORT} ^443$
#RewriteCond %{HTTPS} on
RewriteRule ^(.*)$$1 [R=301,L]
#even tried this - RewriteRule ^(.*)$$1 [R=301,L]

but it redirects every request on https to (even the urls like ( which should ideally be redirected to its http counterpart).

How can I remove the https so that my dynamic URLs are served via plain http? Sorry if this is very novice problem.

share|improve this question

It worked with after swapping the order in the .htaccess file.

RewriteCond %{HTTPS} on
RewriteRule ^(.*)$$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
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.