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.

Archive /

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

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

Navigation File Naming Conventions Override Other Software Packages on the Server


Reply


6 Posts   2057 Views

Avatar
hollyv

Community Member, 2 Posts

29 May 2007 at 5:33am

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?

Avatar
Sam

Administrator, 685 Posts

29 May 2007 at 8:14am

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?

Avatar
xmedeko

Community Member, 94 Posts

31 May 2007 at 12:18pm

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.

Avatar
xmedeko

Community Member, 94 Posts

7 June 2007 at 5:57pm

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("/");

Avatar
elijahlofgren

Google Summer of Code Hacker, 222 Posts

8 June 2007 at 3:28am

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

Avatar
Blueskybeach

11 Posts

11 October 2007 at 5:14pm

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