Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

URL rewriting support: You need mod_rewrite to use friendly URLs with SilverStripe, but it is not enabled.


Go to End


3 Posts   2417 Views

Avatar
Vinneeh

Community Member, 2 Posts

21 November 2014 at 10:05am

Hello Community,

I have made a website with Silverstripe locally on my computer, that went very good. Now I have a live domain and want to install SilverStripe.
I get this warning when I want to install Silverstripe:

URL rewriting support: You need mod_rewrite to use friendly URLs with SilverStripe, but it is not enabled.

I have had contact with the helpdesk of my hosting provider. They have told me that Mod_rewrite is enabled, but i had to put it in the .htaccess, but it is already in that file by standard. So I replied with the following note: To put AllowOveride all on. They said this is not possible because they are a shared webhosting concept, and that Mod_Rewrite should be enough and that it is activated.

Is there a way to succesfully resolve this warning?

Thanks in advance,
Vincent

Avatar
mhdesign

Community Member, 216 Posts

21 November 2014 at 10:18am

Provided that Mod_Rewrite is enabled that should be enough as long as the .htaccess files is correctly configured.

I used to get this error in my local environment all the time, but editing the .htaccess file to the correct path (ie "/") should take things back to the root directory where index.php lives.

Hope this helps!

Avatar
Vinneeh

Community Member, 2 Posts

21 November 2014 at 6:27pm

Thank you for your answer Arthurdent.
I have the installation files in the root of my live domain: /Public/Sites/www.domain.nl/

### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

<Files web.config>
Order deny,allow
Deny from all
</Files>

# This denies access to all yml files, since developers might include sensitive
# information in them. See the docs for work-arounds to serve some yaml files
<Files ~ "\.ya?ml$">
Order allow,deny
Deny from all
</Files>

ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On

RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.php$
RewriteRule .* framework/main.php?url=%1 [QSA]

RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . %1/install.php? [R,L]

</IfModule>
### SILVERSTRIPE END ###

I don't have the knowledge if this .htaccess file is configured properly.
Can you tell me what it should be if it is not alright?

Vincent.