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

How do I enable mod_rewrite so that I can install SS?


Go to End


6 Posts   3847 Views

Avatar
Rikardoavocado

Community Member, 3 Posts

17 January 2011 at 6:38am

Hi everyone,

I'm trying to install SS onto my hostgator hosting and I'm being asked to enable mod_rewrite.

The message reads: You need mod_rewrite to use friendly URLs with SilverStripe, but it is not enabled.

But how do I go about doing this? I keep reading about adding ReWriteEngine On and AllowOverride On to a .htaccess file. Is this correct? And which .htaccess file, there seem to be a few.

I really need some help.

Thanks in advance,

Rikardoavocado

Avatar
swaiba

Forum Moderator, 1899 Posts

17 January 2011 at 8:12am

FYI we are moving from unitedhosting rackspace, but on UH this warning came up - I ignored it - the url would have the index.php in it after installation - I removed it and then never saw it again (infact I delete the index.php now anyway). Basically I am saying give the installation a go and see if it works - it is possible that it is enabled but the ss inatall.php is not picking it up...

Avatar
Rikardoavocado

Community Member, 3 Posts

17 January 2011 at 9:05am

Hi, Thanks for your comments.

I tried the install as you suggested, and it seemed to work.

But I now have the index.php showing up in the URL

http://www.domain.com/index.php/about-us/

What do I do about that? Do I just delete the index.php file to make it come up as http://www.domain.com/about-us/?

Richard

Avatar
Rikardoavocado

Community Member, 3 Posts

17 January 2011 at 10:09am

I manged to get it up and running. I installed via cpanel rather than copying the file via Cyberduck ftp using the ssbits.com screencast.

Thanks for you help though.

Avatar
almoubda

Community Member, 1 Post

17 March 2011 at 8:46am

I tried to install my site's root folder outside public_html, because its an addon domain and I didn't like the idea of having maindomain.com/addondomain.com/ and this caused the mod_rewrite warning to appear during installation. I ignored it and installed, but my site had the index.php problem, suc as addondomain.com/index.php/contact-us
I found a solution by copying the .htaccess file from the maindomain.com root folder (which already had an SS installation) to the root folder of the addon domain

For reference, .htaccess contains the following code:

### 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>

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###

and now the site works perfectly (hopefully no future problems)

I thought this might help

Regards
Ali

Avatar
mhdesign

Community Member, 216 Posts

10 September 2011 at 2:37pm

Now I'm confused... after configuring my machine (Mac OS) so I could actually SEE .htaccess files (I was somewhat bemused to see a pile of these on my desktop) I set up one with the text as supplied above and dragged and dropped it to the root directory on the webserver - except it isn't working. I still have the /index.php/ problem.

Any tips, suggestions, etc appreciated - I'm just a humble designer who, while he doesn't mind getting his fingers dirty with coding, is not a programming guru!

Strangely enough, now I can see the .htaccess file on the server as well...