4572 Posts in 1385 Topics by 1376 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 626 Views |
-
.htaccess mod_rewrite 500 server error

22 February 2012 at 12:22am
Hello.
I have uploaded SS to my server and after trying to run /install.php I got 500 server error. I figured out quickly that the problem is in the default .htaccess file namely in the mod_rewrite part of it:
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine OnRewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>Commenting the SetEnv line:
# SetEnv HTTP_MOD_REWRITE On
fixed the problem but I still got error during the installation process:
Friendly URLs are not working. This is most likely because a rewrite module isn't configured correctly on your site. You may need to get your web host or server administrator to do this for you:- mod_rewrite or other rewrite module is enabled on your web server
- AllowOverride All is set for the directory where SilverStripe is installed
More over after that the 500 server error appeared again!
It took me quiet a long time to find out the install.php script changes .htaccess file back to the default and I had to comment the SetEnv line in install.php createHtaccess() function. This solved the problem.
I am posting this here for two reasons
- because it may help someone with the simmilar problem.
- Don't you think that the automatic initialization of the .htaccess during the installation process is kind of a bug? The default .htaccess is present in the downloaded SS package so why to rewrite it again during installation?
- mod_rewrite or other rewrite module is enabled on your web server
-
Re: .htaccess mod_rewrite 500 server error

23 February 2012 at 12:09pm
the .htaccess is rewritten to update the RewriteBase rule.
For sites sitting in domain roots, this isn't an issue. However if you ever run SS out of a subdirectory, then it needs to be updated.I've never had an issue with the setenv line before.
Infact I hadn't even realise it'd been added.
| 626 Views | ||
|
Page:
1
|
Go to Top |


