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, biapar, Willr, Ingo, swaiba, simon_w

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


Reply


15 Posts   2005 Views

Avatar
Willr

Forum Moderator, 5513 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
Ku$h

Community Member, 14 Posts

13 December 2011 at 10:51pm

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

Avatar
Ku$h

Community Member, 14 Posts

4 January 2012 at 5:33am

Thanks Simon_w, it worked a charm :)

Avatar
Ku$h

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
simon_w

Forum Moderator, 474 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, 135 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
Ku$h

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.