Have something that might be a problem with a simple solution. We have people writing all kinds of characters in the title field of pages. I actually typed a '#' character in the title field, and this ended in a 404. Is there a way to replace these kinds of characters with string.empty or something? Yes, I know there is workaround with umbracoUrlName but there should be some kind of automatic replacement..
Here is an example title I created: Listing all files in a specified folder C# (foreach file in folder)
Giving me this URL: /2009/8/4/listing-all-files-in-a-specified-folder-c#-(foreach-file-in-folder).aspx
you could create a module that checks the current url using a regex and redirect it in the case of junk characters. We have a similar module working on our site to 301 urls with %5 type characters.
Great! I was hoping there was just a setting for this. A custom module was last chance, but was hoping I didn't need to go that long, lonesome road. ;-)
Thomas, Whell I have tried. It sayes solved, but does not save it. When I go into the post again it allows me to set posts as solved again.. Is there any button or link I need to click after checking te "mark this reply as the solution"?
Just a heads up. The urlReplacing tag is removed in Umbraco 7. To achieve this make sure to add something like the following withing the <requstHandler> part.
Rewriting characters in URL
Hi everyone!
Have something that might be a problem with a simple solution. We have people writing all kinds of characters in the title field of pages. I actually typed a '#' character in the title field, and this ended in a 404. Is there a way to replace these kinds of characters with string.empty or something? Yes, I know there is workaround with umbracoUrlName but there should be some kind of automatic replacement..
Here is an example title I created:
Listing all files in a specified folder C# (foreach file in folder)
Giving me this URL:
/2009/8/4/listing-all-files-in-a-specified-folder-c#-(foreach-file-in-folder).aspx
I would like it to just remove '#'.
--------
Christopher W. B.
you could create a module that checks the current url using a regex and redirect it in the case of junk characters. We have a similar module working on our site to 301 urls with %5 type characters.
That is allready possible. Check the umbracoSettings.config in the config-folder.
There's a section there where you can define which characters you want to replace in the URL's. Just add your own to it.
Remember to touch the web.config after you did. You also might need to republish all the pages for the changes to take effect.
HTH,
Peter
In our case we have far too many urls spidered in google from previous guises of the site so they would not be under umbraco control.
Great! I was hoping there was just a setting for this. A custom module was last chance, but was hoping I didn't need to go that long, lonesome road. ;-)
Thanks guys!
Christopher, if a post resolves your problem please mark this post as the solution.
Thanks, Thomas
Thomas, Whell I have tried. It sayes solved, but does not save it. When I go into the post again it allows me to set posts as solved again.. Is there any button or link I need to click after checking te "mark this reply as the solution"?
No I don't think so, this might be reported in the bugs section. But let us wait for the maintenance this noon and check again afterwards.
Thomas
Just a heads up. The urlReplacing tag is removed in Umbraco 7. To achieve this make sure to add something like the following withing the <requstHandler> part.
http://our.umbraco.org/documentation/Using-Umbraco/Config-files/umbracoSettings/
is working on a reply...