Jump to:

4873 Posts in 7171 Topics by 1471 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » mod_rewrite to use friendly URLs

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

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

Page: 1 2
Go to End
Author Topic: 4112 Views
  • Nickname123
    Avatar
    Community Member
    6 Posts

    mod_rewrite to use friendly URLs Link to this post

    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.

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: mod_rewrite to use friendly URLs Link to this post

    contact your hosting company?

  • Kevnolan
    Avatar
    Community Member
    7 Posts

    Re: mod_rewrite to use friendly URLs Link to this post

    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.

  • Kevnolan
    Avatar
    Community Member
    7 Posts

    Re: mod_rewrite to use friendly URLs Link to this post

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

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: mod_rewrite to use friendly URLs Link to this post

    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.

  • Webdoc
    Avatar
    Community Member
    329 Posts

    Re: mod_rewrite to use friendly URLs Link to this post

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

  • Kevnolan
    Avatar
    Community Member
    7 Posts

    Re: mod_rewrite to use friendly URLs Link to this post

    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
  • Webdoc
    Avatar
    Community Member
    329 Posts

    Re: mod_rewrite to use friendly URLs Link to this post

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

    4112 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.