Some .htaccess help needed

Status
Not open for further replies.

nis

New member
Mar 4, 2007
357
4
0
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):
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?
 


Even if I set it to 100 I still get the same error.
Ill look trough your links.
 
Strange. I moved the two lines I added to the .conf file to a .htaccess file in the webroot, restarted Apache, and now everything works perfectly.

Most problems I have usually solve themselves shortly after I have posted somewhere asking for help, making me look like a douchebag.

Thanks for listening ;)
 
Status
Not open for further replies.