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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

sapphire/main.php?url=/ at end of url???

Go to End

8 Posts   2653 Views


SilverStripe Developer, 65 Posts

5 March 2008 at 10:46am

When I visit my homepage "sapphire/main.php?url=/" is after the url. Anyone know why this is happening?



Community Member, 470 Posts

8 September 2008 at 8:35am

I'm currently experiencing this with one of my sites.

Was a reason ever found?


Forum Moderator, 5523 Posts

8 September 2008 at 3:33pm

?url=/ gets appended if you try and visit rather then I think a simple .htaccess rule fixes that?


Community Member, 470 Posts

9 September 2008 at 3:08am

I figured out it was an issue with my .htaccess.

This part below:

RewriteCond %{HTTP_HOST} !^(.*)\.domain\.ca$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

Since sites with and without the www in the URL are treated as different sites from an SEO perspective, this helps solve that problem and stick to one.

I'm only getting the junk part added on to the URL if I visit since it then forwards to the WWW.

Trying to work something out now...Not sure what I can do.


Community Member, 135 Posts

9 September 2008 at 7:21am

Try using a rewrite like this, instead of the one you are currently using.

### www Redirect Start ###
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]
### www Redirect End ###


Community Member, 470 Posts

9 September 2008 at 12:03pm

Thanks, but same thing.

Not really sure if there is a workaround for this, cause the .htaccess is valid. This is more of a CMS thing.


Community Member, 59 Posts

9 September 2008 at 1:08pm

Edited: 09/09/2008 1:16pm

I have similar to what has been stated, you just have to make sure it's before the SS rewrites. My file is:

RewriteEngine On
RewriteBase /

# Duplicate content prevention redirect
RewriteCond %{HTTP_HOST} !^$ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

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]

works great


Community Member, 470 Posts

10 September 2008 at 2:13am

Nice! That did it. Great to know since I use this on all sites I build. Only noticed it on the one, but all would be effected.