views:

32

answers:

1

Any ideas on why this rewrite rule works in a subdomain, (dev.domain.co.uk) but not when placed in the top level domain (domain.co.uk) fails with a 500 Internal Server Error ?

ReWriteEngine on
ReWriteCond $1 !^(images|img|stylesheets|db|themes|index\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]

It meant to parse all files as if the index.php file is there, except for the files between the brackets in the second line.

When use in a subdomain it works and removes the index.php from ExpressionEngine URLs. Thus

www.dev.domain.co.uk/index.php/about/ becomes www.dev.domain/about/ - much nicer

Any help or suggestions much appreciated - thank you.

A: 

I'm guessing here, but maybe there's something different about the directory structure when you're using the domain name rather than the subdomain. If URLs are not directly related to physical file path, then modrewrite will fail. You could try adding this before the rewritecond, to make the Base URL explicit

RewriteBase /
andrewmabbott