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:

Archive /

Our old forums are still available as a read-only archive.

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

Changing the URL layout

Go to End

5 Posts   3211 Views


Community Member, 3 Posts

31 March 2007 at 7:45am

Is there a way to drop the / at the end of URLS and add .html or something similar?

If this isn't possible, where is the function that constructs URLs? If this can be adapted, then mod_rewrite can be used to rewrite .html to /.



Forum Moderator, 628 Posts

3 April 2007 at 2:37pm

Is this to ensure old website URLs are retained, or because you have a preference for the .html extension?

You could .htaccess to accept the .html extension and pass it to sapphire/main.php, however SilverStripe would continue to write links on the page to the normal format.


Community Member, 1 Post

6 December 2007 at 6:25am

Edited: 06/12/2007 6:26am

Hi Sigurd,

I saw this post, but it looked like it never continued. I'm also looking to do exactly as you noted, preserve all existing URLs by allowing for ".html" to be at the end of the URL instead of "/". I'd also like to have the URL sections divided up into separate directories using "/".

So, for instance, we have an original URL that appears:

We don't want to change ANYthing about the URL and fuss with current rankings or inbound links (even with a redirect). Currently, with Silverstripe, we can only accomplish this:

Should edits to the main.php file be able to resolve this? I know the validation in the Meta-Data section seems fairly strict about choosing non-alphanumeric characters. Can this limitation be manually removed without a cascade affect of related issues?

~ Dudley


Community Member, 32 Posts

13 December 2007 at 1:33am

Edited: 13/12/2007 11:11pm


I have the same need, preference regarding the URL layout.
Not only the missing page extension but also the very flat url structure could be a problem.

SilverStripe uses a "root structure".

Independent of the site structure and path deepness the URL looks like this: .

Ending slash is treated as folder structure with containing sub-pages if you use Google Analytics. Particularly if you have a lot of pages with a clear parent/child structure this could prove to be difficult for analysing purpose. With the actual path logic I don't see any potential to have cumulated reports for grouped pages (e.g. all product pages, all services, etc.), because there is no common path denominator.

Good luck if you have to analyze a website with a hundred pages on the root.

==> Would be nice if you could discuss this point for a next major release :-))




Community Member, 791 Posts

14 December 2007 at 2:31am

Hi Guys,

This is a subject that keeps on coming back on the forum. There are some workarounds, but I think the overall feeling is that this needs to be done. It's just not so easy to do .... ;)

Let's try to keep the discussion about this in 1 thread.

See for example :