-
- 91 Posts
Hi Guys,
I'm sure this is gonna be something that's simple to achieve and I'm just not thinking straight but say I have a directory in my webroot directory called "dev"
When I go to www.domain.com/dev how can I get MODX to stop redirecting this URL. I get that it's doing it because there the resource doesn't exist within MODX but I need to make an exception.
Thanks
Twitter @alexmercenary
The problem is that the web server's rewrite rules are sending any files or directories it doesn't find to MODX.
In your .htaccess file have something like this:
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/dev
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
So if it doesn't find a file (!-f), or if it doesn't find a directory (!-d), or if it isn't "domain.com/dev..." then send it to MODX.
Or you may be able to have an .htaccess file in the dev directory to turn off the rewrite engine altogether for that directory.
-
- 91 Posts
Thanks for the reply Susan,
I've tried that and it doesn't seem to be working for some reason. If I create a file named dev.html and request domain.com/dev.html that works but not for a directory.
Stumped.
Any thoughts?
Thanks
UPDATE: Sorry if I add any .html file at the root and request it they work. So it's just directories that I can't get working. I need rewrites enabled in the dev directory too.
Twitter @alexmercenary
-
- 14 Posts
Cant you just drop another .htaccess in the dev directory with rewrite rules associated to it specifically? Maybe i'm thinking of php.ini..
-
- 91 Posts
The dev directory does have it's own rewrite rules. But the MODX .htaccess is redirecting the request to that directory throwing a 404. So something in the MODX .htaccess is catching that URL segment. But I don't know what.
Twitter @alexmercenary