Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Navigation File Naming Conventions Override Other Software Packages on the Server

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1984 Views
  • hollyv
    Avatar
    Community Member
    2 Posts

    Navigation File Naming Conventions Override Other Software Packages on the Server Link to this post

    This is not an ultimate deal breaker, but I'm wondering if there's a way around it.

    Silverstripe creates navigation with a directory schema: domain.com/about-us/
    Instead of: domain.com/aboutus.html

    As a result, if I pop in the directory level destination to another server package (not silverstripe) I am getting a 404 error... unless I add the actual page.

    domain.com/link/ = 404 error because link is a link database ... not part of SS, but a legitimate destination on the server.

    domain.com/link/index.html = the link database.

    Okay, normally, I'll tell people to go to yadayada.com/blog ... because I don't have to add index.html... the server will automatically bring up the page.

    Plenty of websites have multiple programs and packages running on one server. I'm happy to have silverstripe manage content, but if the URL requested is out of its domain, silverstripe should not, ideally, be controlling the destination page.

    Any idea how to disable that?

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Navigation File Naming Conventions Override Other Software Packages on the Server Link to this post

    A tweak to the .htaccess file is probably needed. Right now SilverStripe processes any request that isn't a file. It probably needs to process any request that isn't a file OR a directory.

    Anyone want to have a go at patching the .htaccess file?

  • xmedeko
    Avatar
    Community Member
    94 Posts

    Re: Navigation File Naming Conventions Override Other Software Packages on the Server Link to this post

    here's a one possibility how to do it for 'CRM' direcory and all it's subdirecotries.
    First, move the line

    RewriteEngine On

    to be the first line in .htaccess, then add

    ## CRM is not in SilverStripe
    RewriteRule ^CRM$ - [L]
    RewriteRule ^CRM/.* - [L]

    and finaly put lines after
    ### SILVERSTRIPE START ###
    ...

    If you many direcotries, you may try 'RewriteMap' option and txt config file.

  • xmedeko
    Avatar
    Community Member
    94 Posts

    Re: Navigation File Naming Conventions Override Other Software Packages on the Server Link to this post

    Here's another solution, move SS to a directory ss/, then in the document root make .htaccess:

    RewriteEngine On

    # list of directories, which are not handled by SS
    RewriteRule ^somedir$ - [L]
    RewriteRule ^somedir/.* - [L]

    ## Averything else to SS
    RewriteRule ^(.*)$ ss/$1 [L,QSA]

    Then go to the ss/mysite/_config.php and add the line:

    Director::setBaseURL("/");

  • elijahlofgren
    Avatar
    Google Summer of Code Hacker
    222 Posts

    Re: Navigation File Naming Conventions Override Other Software Packages on the Server Link to this post

    Adding this line to .htaccess:
    RewriteCond %{REQUEST_FILENAME} !-d
    before:
    RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
    makes SilverStripe ignore requests for existing directories.

    Here is a patch for install.php that adds that line to the .htaccess file:
    http://www.elijahlofgren.com/silverstripe/patches/Make-htaccess-not-process-requests-for-existing-directories-2007-06-07.patch

    Hope this helps,

    Elijah Lofgren

  • Blueskybeach
    Avatar
    11 Posts

    Re: Navigation File Naming Conventions Override Other Software Packages on the Server Link to this post

    I accidentally deleted my .htaccess file - well uploaded the local copy from before installation to the remote site (using Dreamweaver). I just clicked on over-write remote file, not thinking...

    Could someone please copy and paste the entire contents of the .htaccess file in for me? I'd really appreciate it.

    Many thanks,
    Kirk

    1984 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.