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.

Installing SilverStripe /

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

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

mod_rewrite to use friendly URLs


Go to End
Reply


9 Posts   5008 Views

Avatar
Nickname123

Community Member, 6 Posts

3 February 2011 at 7:08am

Hi Guys,

I'm trying to install SilverStripe onto my server but am having a little trouble.

Everything has passed except the URL rewriting support, this is the error I'm getting ..

"You need mod_rewrite to use friendly URLs with SilverStripe, but it is not enabled."

It makes it so my website can onlt be accessed as www.mydomain.com/index.php instead on www.mydomain.com

Any ideas would be great thank you.

Avatar
swaiba

Forum Moderator, 1805 Posts

12 February 2011 at 12:07am

contact your hosting company?

Avatar
Kevnolan

Community Member, 7 Posts

15 September 2011 at 2:59am

This seems to be a re-occuring problem I've searched high and low on the internet but can not find a solution to the mod_rewrite issue

My hosting provider: 1and1.co.uk

I've never got this to fully work and I had problems with a wordpress blog that used the same hosting space and I have worked away around this by using a sub domain for the wordpress blog.

1and1 customer support, sent me the following message and i'll be honest, its a little confusing as im not an advanced techy person:

This is an email update about your call earlier. As we forward your issue with our higher support to check, we received updates that system requirements for the application installed was actually met with the current package that you have. We actually checked all necessary settings with the server with your domain and was actually working fine. It was concluded that this issue was actually into the configuration of the application you used. We tried to serach it any possible solutions for the error message that you received and it has something to do with one of your php file.

Based on our source, it was advice to reinstall again the application to the server and access to a (mysql) database, then use the database dump to update the database. Next you need to update the database credentials you'll find in the /mysite/_config.php settings.

Make sure you have a /silverstripe-cache/ directory and make it writable (if it exists and there are still any files in it, you can throw them away first). Make sure the /assets/ directory and all that's in it is writable as well.

To give you for information, please contact the application support.

You can also refer from this link: http://www.leftandmain.com/silverstripe-tips/2010/09/08/8-common-silverstripe-errors-explained-and-solved/

If you have any further questions please do not hesitate to contact us.

--

how do i make a silverstripe-cache directory?
how do i make it writable?
and where do I put this directory?

how do i make the assets directory writeable?

the link they gave didnt really help.

I would love a solution to be out there for this problem, I think a lot of people would be happy aswell.

Avatar
Kevnolan

Community Member, 7 Posts

15 September 2011 at 3:11am

is it the root .htaccess directory?
i notice there is more than 1.

Avatar
Ryan M.

Community Member, 309 Posts

15 September 2011 at 9:49am

Yes, Silverstripe relies on mod_rewrite for friendly URLs. If your server doesn't have the module, you can't use friendly URLs. Simple as that.

To create a silverstripe-cache directory, simply create it on the server inside your Silverstripe root folder then chmod it to 777 or whatever permissions you prefer. It needs to be writable by the web server though.
Assets directory should be 666 or 777.

Avatar
Webdoc

Community Member, 333 Posts

15 September 2011 at 10:21am

Try this in .htaccess

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

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

<IfModule mod_alias.c>
   RedirectMatch 403 /silverstripe-cache(/|$)
</IfModule>

<IfModule mod_rewrite.c>
   SetEnv HTTP_MOD_REWRITE On
   RewriteEngine On
   RewriteBase /

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

Avatar
Kevnolan

Community Member, 7 Posts

15 September 2011 at 10:09pm

Ok I have changed the .htaccess file in the root as per 'webdoc'.

I've added silverstripe cache folder to the root also with 777 permissions.

Assets folder has had permissions changed for 777.

All done as instructed by people on here and 1and1's 'higher level' support staff.

One solution is to leave 1AND1 as to it looks like the are unpolitely saying we're not prepared to support silverstripe, but the fact that on there home page they advertise 'click and build' applications, that customers can use.
http://www.1and1.co.uk

I've tried to find this function in my login area but I cant find it.

I'm going to call them now

Attached Files
Avatar
Webdoc

Community Member, 333 Posts

16 September 2011 at 6:55am

If the install is in root folder use RewriteBase /
if in some subfolder use RewriteBase /subfoldername/

Go to Top