When I visit my homepage "sapphire/main.php?url=/" is after the url. Anyone know why this is happening?
:)
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
When I visit my homepage "sapphire/main.php?url=/" is after the url. Anyone know why this is happening?
:)
I'm currently experiencing this with one of my sites.
Was a reason ever found?
?url=/ gets appended if you try and visit yoursite.com/page rather then yoursite.com/page/ I think a simple .htaccess rule fixes that?
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.
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 ###
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.
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
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.