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've moved the forum!

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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

SS doing a SEO no,no... Duplicate content!


Go to End


15 Posts   4579 Views

Avatar
Willr

Forum Moderator, 5523 Posts

13 December 2011 at 7:51pm

AFAIK you can't do this easily in .htaccess. I spent a while banging my head on it. There are solutions if you want to hardcode your base url but this does not work for the framework so not suitable.

See http://open.silverstripe.org/ticket/6700 for a bit of a discussion on this as well as http://pastie.org/2373435. It doesn't trim the extension off like it probably should (didn't notice that behaviour).

Avatar
Pixel Labs

Community Member, 14 Posts

13 December 2011 at 10:51pm

Thanks for the help. I guess it a Page_Controller edit after all.

Avatar
Pixel Labs

Community Member, 14 Posts

4 January 2012 at 5:33am

Thanks Simon_w, it worked a charm :)

Avatar
Pixel Labs

Community Member, 14 Posts

7 January 2012 at 5:26am

Hmm, maybe I spoke too soon. When I try to login to the admin by appending /admin I get this error:
Fatal error: Call to a member function getExtension() on a non-object in /hsphere/local/home/client/mywebsite.co.uk/mysite/code/Page.php on line 36

Anyone got any ideas how I could write an exception to allow the /admin sudo-folder to work? Otherwise it's working like a charm.

Thanks.

Avatar
(deleted)

Community Member, 473 Posts

10 January 2012 at 8:38pm

If you change the if statement to:

if($this->request && $this->request->getExtension()) { 

it should work. Otherwise,
if($this->request instanceof SS_HTTPRequest && $this->request->getExtension()) { 

will.

Avatar
Nobrainer Web

Community Member, 138 Posts

12 January 2012 at 11:55am

Well my SEO pro is also not so happy about alot of stuff SS is doing, stuff like http://www.nobrainer.dk/?url=services and http://www.nobrainer.dk/index.php/services gives same page as http://www.nobrainer.dk/services and http://www.nobrainer.dk/services/ the missing trailing backslash i have fixed in the htaccess, but this stuff should really be fixed in core by advice from a SEO pro.

Avatar
Pixel Labs

Community Member, 14 Posts

21 February 2012 at 12:50am

Sorry for the delay in replying, but Thanks Simon, that update worked perfectly. This bit of code will be used on all of our SS projects from now on. Suggest this is made core.
Duncan.

Go to Top