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

I have a site ( in which I'm testing my e-commerce framework on. I was trying to test payment using a shared SSL:

I had to change my htaccess file to work with the SSL:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} secure-secure\. [NC]
RewriteBase /
RewriteRule ^[a-z0-9\-_/\.]*$ index.php [L]

RewriteCond %{HTTP_HOST} the-tack-shop\. [NC]
RewriteBase /
RewriteRule ^[a-z0-9\-_/\.]*$ index.php [L]

RewriteRule ^.* [L]

This will work with the SSL domain, but not with the normal domain. Comment out the second rewritebase and it will work on the normal domain but not on the SSL domain.

Can anybody please tell me where I am going wrong?

share|improve this question

Apache is perfectly capable of doing what you are asking, however, the RewriteBase directive is not the prescribed way of achieving your desired results.

You have two options:

  1. Instead of using RewriteBase, just specify the base path in your RewriteRule declarations

  2. Create separate NameVirtualhost declarations instead of relying upon a catch-all

share|improve this answer

I'm also looking for some similar solution. This one might help:

share|improve this answer
Hello, welcome to Serverfault. It's preferable if your answer can contain the full text of a solution, rather than a link to another site, links stop work sometimes and we would like SF to be the repository of answers, not links to answers. – Sam Jan 19 '12 at 21:26

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.