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

I'm getting pretty confused my htaccess file.

If I use the following directives:

RewriteCond %{REQUEST_URI} distribute$
RewriteRule (.*) BalanceManager.php [L]

Then I expect to redirect to with POST data in place... this is exactly what happens, which is great.

I also expect https://184.22.345.77/distribute to redirect to https://184.22.345.77/BalanceManager.php with POST data in place. It does NOT do this, it throws a 404 not found.

I need this to work on IP addresses and under SSL protocol, but have failed to get anything to work yet.

Is there a right way to do this? Are there alternative ways to acheive this?

I can address the file directly, using and that works, but when I look up https://184.22.345.77/BalanceManager.php in my browser, it throws a 404.

The host is within the Amazon Web Services architecture, and importantly... I am using a load balanced Wordpress site.


share|improve this question

migrated from Oct 5 '12 at 11:50

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

I need this to work on IP addresses and under SSL protocol, but have failed to get anything to work yet.

Your IP is probably pointing to your default vhost and not the vhost that serves That's why you can't get to https://184.22.345.77/BalanceManager.php. Additionally, your SSL certificate won't work for an IP address if you've made the CA-Request for Browsers will load it and give you a certificate error because the IP isn't

If you don't care about the certificate error, you could add this line to your vhost config (inbetween the <VirtualHost> </VirtualHost> block):

ServerAlias 184.22.345.77
share|improve this answer
That's a good idea but unfortunately going to 184.22.345.77/anything-u-like does work (unsure now if it shows a certificate error, don't think it does). This is a Wordpress site.. I need to override the default routing for WP I think, will try again tomorrow. – AlexW Oct 4 '12 at 19:19
Actually I see what you mean now (still haven't had a chance to work on it). I may need to use the server's internal network IPs instead... – Alex Oct 7 '12 at 21:51

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.