Is there a way to find out if a server supports mod_rewrite & .htcaccess
views:
102answers:
2
+3
A:
http://us3.php.net/apache_get_modules will output something similar to the following:
Array ( [0] => core [1] => http_core [2] => mod_so [3] => sapi_apache2 [4] => mod_mime [5] => mod_rewrite )
Just look for mod_rewrite. You could even write a small function using in_array() to make it easier to determine whether a given module is loaded or not.
Jonathan Sampson
2009-09-11 14:09:17
+1. Your idea is better than mine.
Randolph Potter
2009-09-11 14:09:57
This does not show if rewrite rules can be set using a .htaccess
gnud
2009-09-11 14:12:26
Good info and worth a vote, but I'm pretty sure that wouldn't tell you if 1. RewriteRules were on for your virtual domain or 2. AllowOverrides were on for your virtual domain.
Alan Storm
2009-09-11 16:19:30
+3
A:
I'd create a test scenario by adding mod_rewrite to .htaccess. There's an example here.
Randolph Potter
2009-09-11 14:09:29
To .htaccess thats the only way after all. Many hosts doesn't accept files named ".htaccess" or have AllowOverride disabled.
Havenard
2009-09-11 14:17:31