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

slash or no slash bad request


Reply

4 Posts   1603 Views

Avatar
kjello

25 August 2008 at 10:40am Community Member, 7 Posts

I was so impressed with SilverStripe that I installed it on my live server. First problem I encountered was that I had to manually set the permissions. I did not expect this since I unpacked the compressed file right on the server. It was the assets, tutorial, mysite folders and the .htaccess file. I had to change them all to 777. Does anyone know what the permissions are supposed to be post install?

After installing the system when I visit the site with no slash I get a "400 Bad Request" Your browser sent a request that this server could not understand. I've checked with the server requirements and there are no issues. The really weird thing is that if I go to the site with a "/" at the end of it, it works just fine. This will be way too confusing. Please HELP!

The site is http://www.movingworship.com/cms - doesn't work
http://www.movingworship.com/cms/ - does work.
Hosting is by A Small Orange. I've already checked with them and they say that it's something in SS scripting.

Avatar
grilldan

25 August 2008 at 11:25am Community Member, 135 Posts

I have a few guesses.

1. Its a problem with your .htaccess file.
2. cms is the name of a folder, and when you leave the "/" off the end, the browser doesn't go to it like a folder.

I am leaning towards guess 1.

Also, if you are going to post the site url, try setting the user and password to something else :)

You could just say:
http://mysite.com/cms - doesn't work
http://mysite.com/cms/ - works

Avatar
kjello

25 August 2008 at 1:54pm Community Member, 7 Posts

Good call, I didn't even think about the user/pass. Anyway I trashed the install on the hunch that the cms directory I put SS in might be competing with the cms directory in silver. And I changed the username and password.

So I'm worthless with .htaccess files. Any thoughts. I didn't change the .htaccess from it's original packaged self. See below. Any other info needed?

### SILVERSTRIPE START ###
RewriteEngine On
RewriteBase /silver

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

Avatar
kjello

25 August 2008 at 2:25pm (Last edited: 25 August 2008 2:59pm), Community Member, 7 Posts

answer to question:

http://silverstripe.com/site-builders-forum/flat/35627?showPost=153529

Only partially. . . so I changed line 7 to:

RewriteCond %{REQUEST_URI} ^(.*)/$

which adds the / before the $. It worked, but admin can't load without the slash either. Logout doesn't work either. I'm pretty confused and I don't even know where to begin with .htaccess files. Anymore help out there?