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

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


Reply


8 Posts   2147 Views

Avatar
Josh

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?

:)

Avatar
Liam

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?

Avatar
Willr

Forum Moderator, 5513 Posts

8 September 2008 at 3:33pm

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

Avatar
Liam

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 ^(.*)$ http://www.domain.ca/$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 http://domain.ca since it then forwards to the WWW.

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

Avatar
grilldan

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} ^yoursite.com [NC]
   RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
### www Redirect End ###

Avatar
Liam

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.

Avatar
StuM

Community Member, 56 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:

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

# Duplicate content prevention redirect
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$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]
### SILVERSTRIPE END ###

works great

Avatar
Liam

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.