Jump to:

4952 Posts in 14480 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Moving to Live Server but i got an error about DirectorySlash...

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

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

Page: 1
Go to End
Author Topic: 2197 Views
  • Penalba
    Avatar
    Community Member
    2 Posts

    Moving to Live Server but i got an error about DirectorySlash... Link to this post

    I have moved a SSsite to a live server, moving files and loading the database into the live server, but i got the next error:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, webmaster@sandinismo.info and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    This is my log...

    [Thu Dec 18 11:45:59 2008] [alert] [client x.x.x.x] /home/myuser/public_html/.htaccess: Invalid command 'DirectorySlash', perhaps mis-spelled or defined by a module not included in the server configuration
    [Thu Dec 18 11:22:44 2008] [error] [client x.x.x.x] File does not exist: /home/myuser/public_html/404.shtml
    [Thu Dec 18 11:22:44 2008] [error] [client x.x.x.x] File does not exist: /home/myuser/public_html/favicon.ico

  • Penalba
    Avatar
    Community Member
    2 Posts

    Re: Moving to Live Server but i got an error about DirectorySlash... Link to this post

    Here is my .htaccess

    ### SILVERSTRIPE START ###
    <IfModule mod_dir.c>
    DirectorySlash Off
    </IfModule>

    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

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

  • HallMarc
    Avatar
    Community Member
    3 Posts

    Re: Moving to Live Server but i got an error about DirectorySlash... Link to this post

    The DirectorySlash directive determines, whether mod_dir should fixup URLs pointing to a directory or not.

    Typically if a user requests a resource without a trailing slash, which points to a directory, mod_dir redirects him to the same resource, but with trailing slash for some good reasons:

    The user is finally requesting the canonical URL of the resource
    mod_autoindex works correctly. Since it doesn't emit the path in the link, it would point to the wrong path.
    DirectoryIndex will be evaluated only for directories requested with trailing slash.
    Relative URL references inside html pages will work correctly.

    This section of code is just making sure that this is turned off and is only available in Apache versions 2.0.51 and later which means if you are on a server with an older version of Apache this will result in a 500 server error.
    To check which version of Apache your server is running create a php file with this code

    <?php
    phpinfo();
    ?>


    upload it to your hosting account, point your browser to it, look near the bottom under Enviroment and near the bottom of this section.
    !Important! - Make sure you remove this file from your server when you are done.

    Just remove these 3 lines from your .htaccess file and you will be good to go. No harm in removing them.

    <IfModule mod_dir.c>
    DirectorySlash Off
    </IfModule>

    2197 Views
Page: 1
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.