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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

CMS auto inserting page URL before # anchor

Go to End

7 Posts   2776 Views


Community Member, 151 Posts

14 September 2011 at 7:18pm

Hi everyone

I have an issue, SS is auto putting URL into my A tags...

<ul class="tabs"><li><a href="northampton-seo-company#tab1">Real SEO Company</a></li>
<li><a href="northampton-seo-company#tab2">The RIGHT choice</a></li>
<li><a href="northampton-seo-company#tab3">Our Ethics</a></li>
<li><a href="northampton-seo-company#tab4">Here to help!</a></li>

in the CMS it is

<ul class="tabs"><li><a href="#tab1">Real SEO Company</a></li>
<li><a href="#tab2">The RIGHT choice</a></li>
<li><a href="#tab3">Our Ethics</a></li>
<li><a href="#tab4">Here to help!</a></li>

How do I turn it off? As my script wont work with the first example...

Any help would be great! thanks,


Forum Moderator, 5523 Posts

14 September 2011 at 7:55pm

SS does that automatically to fix any issues with having the base url defined. You can disable the behavior using SSViewer:: dontRewriteHashlinks();


Community Member, 151 Posts

14 September 2011 at 9:15pm

Hi willr

thanks for that. Does this go into mysite/_config.php?



Community Member, 151 Posts

15 September 2011 at 12:00am

Got it working.

You edit the code in mysite/code/page.php.

Simply add the line to:

public function init() {




Community Member, 70 Posts

2 August 2013 at 3:58pm

is there a recomended way of doing this for 3.1 please


Forum Moderator, 5523 Posts

2 August 2013 at 6:19pm


Community Member, 70 Posts

7 August 2013 at 5:36pm

Edited: 07/08/2013 5:37pm

thanks. From that page:
"There are cases where this can be unhelpful. HTML fragments created from Ajax responses are the most common. In these situations, you can disable fragment link rewriting by setting the SSViewer.rewrite_hash_links configuration value to false."

which you do like this:

// /mysite/_config/confg.yml
--rewrite_hash_links: false

(replace -- with two spaces, i couldn't make the code block play nice)

in case anyone ends up here after me...