I have a domain where I have set up dynamic sub-domains, so that sub.domain.com gets shown what's in webroot/sub/
I have put this in the .conf file for the domain (Apache server):
The first set of Cond/Rule where there already. I just added the two bottom lines.
So far. So good. If I add a new folder of files to the webroot, it can be accessed via its own subdomain.
The trouble starts when I put a .htaccess file in there to handle traffic. This is my .htacces:
It basically send all traffic to index.php which then redirects it as needed.
Only thing is when I combine the two parts I get Internal Server Errors and this in my error-log:
Im a bit of a newbie when it comes to troubleshooting mod_rewrite. Anybody got a clue?
I have put this in the .conf file for the domain (Apache server):
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.tld
RewriteRule ^(.*)$ /%1/$1 [L]
</IfModule>
The first set of Cond/Rule where there already. I just added the two bottom lines.
So far. So good. If I add a new folder of files to the webroot, it can be accessed via its own subdomain.
The trouble starts when I put a .htaccess file in there to handle traffic. This is my .htacces:
Code:
Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ index.php [L]
It basically send all traffic to index.php which then redirects it as needed.
Only thing is when I combine the two parts I get Internal Server Errors and this in my error-log:
Code:
[Thu Aug 9 11:04:20 2007] [error] [client MyIP] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
Im a bit of a newbie when it comes to troubleshooting mod_rewrite. Anybody got a clue?