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.

Archive /

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

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

SOLVED: URL naming issue: appending -2 to URLSegment


Go to End


4 Posts   1613 Views

Avatar
workshed

Community Member, 4 Posts

30 September 2008 at 12:06pm

Edited: 30/09/2008 2:22pm

Hi All-

We're building a site that is dependent upon having specific URLs for landing pages, such as:

http://www.domain.com/dan
http://www.domain.com/matt
http://www.domain.com/jane
http://www.domain.com/kat

When I initially created the pages, they URLs worked just fine. After another of our devleopers made some changes and switched the pages to use some different templates, the URLs now all have "-2" appended to them and we cannot get them to save without:

http://www.domain.com/dan-2
http://www.domain.com/matt-2
http://www.domain.com/jane-2
http://www.domain.com/kat-2

Does anyone know how to permanently fix this? I did go in and directly change the URL on one of the pages in the database, which worked, but now if I edit the page, it appends the -2 on it once again.

Thanks!

-Bret

Avatar
workshed

Community Member, 4 Posts

30 September 2008 at 12:23pm

Edited: 30/09/2008 1:06pm

I've tried deleting all references to dan and dan-2 in the sitetree_versions and then renaming the ones in sitetree and sitetree_live, but each time I save it, the -2 gets appended again. Help!

Avatar
Willr

Forum Moderator, 5523 Posts

30 September 2008 at 1:58pm

Make sure all traces are removed from sitetree, sitetree_live, sitetree_versions and it should work fine. The other thing you cannot do that I found out was eg I had a class called Job then tried to create a page with a url of 'job/' but of course ss rewrote this to job-2/ as you can't have a class and a page with the same url

Avatar
workshed

Community Member, 4 Posts

30 September 2008 at 2:22pm

That was it -- and it's funny, just as I was about to try renaming the template object names, your reply came through. That did the trick! Thanks!