Lets say, my root domain name is main.com and I have two addon domains: addon1.com and addon2.com.
My script is already ready and I can see my websites like this:
www.main.com/show.php?domain=addon1.com
But, what I want is displaying websites through their domains. I mean when I open addon1.com, I want to see output of show.php?domain=addon1.com. Also these two domains are added as addon domain and their directory are:
main.com/addon1.com/
main.com/addon2.com/
I wrote a htaccess file to root folder (main.com/.htaccess)
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.addon1\.com$ [NC]
RewriteRule ^(.*)$ /show.php?domain=addon1.com&$1
RewriteCond %{HTTP_HOST} ^www\.addon2\.com$ [NC]
RewriteRule ^(.*)$ /show.php?domain=addon2.com&$1
But I'm getting 500 interval error. Any advice?
Thanks in advance.
Your rules are looping. The
/show.php
is going back through the rewrite engine and looping indefinitely. You need to add conditions so they don't loop: