Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Hi I am currently using the below code in my apache httpd.conf file to redirect from HTTP to HTTPS

Redirect 302 /GladQE/link
Redirect 302 /GladQE/retrieve

This redirects parameters from a get request but not from a post. From reading on here it looks like this needs to be done using mod_rewrite.

Can somebody help with the amendments I would need to make so that when the link on the left is hit using post params it redirects to the link on the right with the params intact?

Many thanks


share|improve this question

Looks like Apache config? It's a good idea to specify things like that. The tags confirm it though.

That config only runs when they connect on port 443, so it can't redirect from HTTP.

You can't do a 30[12] redirect in response to a POST request and keep the arguments unless you convert the request to a GET and write the arguments into the URL. Not really recommended.

You can proxy the request, but I'm not sure that solves your problem.

If the user has already submitted data via POST over an unencrypted connection, and you care about the encryption, you're probably best to let that request break anyway, so it gets noticed and fixed. You should be fixing your form target, and also making sure that the form itself (or the page with AJAX in it or whatever) is sent to the user over HTTPS.


Given that shawsy has said that the problem is that The browser cannot make HTTPS connections to the server, a redirect is definitely not what's wanted. Rather you want to proxy the request:

  ProxyPass /GladQE/link
  ProxyPass /GladQE/retrieve

You could alternatively do it with mod_rewrite and RewriteRule.

There are some extra issues to work out if you're changing the domain name, but I think that's not the case here.

Just as an aside, I personally don't like putting host names or IP addresses anywhere except in the server's /etc/hosts file. If you use names in the hosts file like 'web' and 'mysql', which locate services rather than machines, and you refer to those in your apache and other files, then you can move configuration between machines much more easily, knowing that you only have to go over what's in the hosts file.

share|improve this answer
Yes, Sorry I didnt mention the code is from httpd.conf file. I also made a mistake on the virtual host tag. I have now ammended to port 80 not 443. – shawsy Jun 5 '13 at 14:31
Currently the Load balancer solution in place cannot handle ssl. This is why i am forward the request as http and then redirect to https once the correct web server has been hit. Sorry but my knowledge on this is far from average. – shawsy Jun 5 '13 at 14:34
Then a redirect is definitely not what you want. – mc0e Jun 5 '13 at 14:58
Do I need to have the file in the modules folder? The only files I have in the modules folder are httpd.exp and – shawsy Jun 6 '13 at 10:37
you will need mod_proxy. How you go about configuring that varies a bit between different operating systems and distributions. – mc0e Jun 7 '13 at 18:10

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.