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.

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   3436 Views


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 for a bit of a discussion on this as well as It doesn't trim the extension off like it probably should (didn't notice that behaviour).

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.

Pixel Labs

Community Member, 14 Posts

4 January 2012 at 5:33am

Thanks Simon_w, it worked a charm :)

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/ 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.



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()) { 


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 and gives same page as and 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.

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.

Go to Top