GetSimple Support Forum

Full Version: trailing slash in url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Polyfragmented reminded me about a bug, which I wanted to mention.
Every slug gets a trailing slash in menu.
It sometimes doesn't show up at the end of url in browser's url strip, but that happends rarely.

Any ideas how to get rid of this weird problem ?
it is added if you use the function find_url() to get the url... all paths using fancy urls get the trailing slash. But of course, if you just type in the URL (either into the browsers address bar, or your template, or your page's body) then it won't have that trailing slash.

If you are using the header template tag within your theme, you should see that the canonical url always has the trailing slash.
Until 2.01 the default fancy url structure was: parent/slug
In 2.03 it was changed to: parent/slug/
though you can remove the slash: settings -> custom permalink -> %parent%/%slug%

If you have mixed style links in your site, you might be using some plugin that generates old style links (not using find_url() function)
Ohhh thx gentlemen for explanations.
It was so simple (%parent%/%slug%), but as always didn't think about trying it out.
Instead I wanted to dig into the code :|

What was the reason of adding a trailing slash by default ?
There was a discussion about rewriting links, pages recognized as directories, abut actually I have no idea about the main reason.
Thanks!
I'm a newby here can someone please explain to me what is the significance of adding a trailing slash?
bowyia Wrote:I'm a newby here can someone please explain to me what is the significance of adding a trailing slash?

a trailing slash "gives the impression" of a directory not a file
one of the reasons for this could be that it is positive for SEO
You are right Connie...the search engine robots look at an ending backslash as meaning a directory and give it a higher ranking which in turn helps you get further up the ladder on that climb to the first page of search engines.
I've been digging for some information about this matter, and seems that trailing slash may be SEO positive option. But duplicated content, as it is now in GS, works exactly opposite thing.
I forced the pages to have trailing slash in menu, but if I write the url manually without trailing slash, the page isn't automatically redirected to URL with trailing slash.
Seems that some rewrite rules will have to be added/changed to redirect pages without trailing slash using a 301 redirect.

But I ask firstly if it can be achieved somehow without messing with htaccess ?
Activate canonical URLs in gsconfig, those have the trailing slash.
polyfragmented Wrote:Activate canonical URLs in gsconfig, those have the trailing slash.

I am still amazed with GS simplicity Smile
ccagle8 Wrote:it is added if you use the function find_url() to get the url... all paths using fancy urls get the trailing slash. But of course, if you just type in the URL (either into the browsers address bar, or your template, or your page's body) then it won't have that trailing slash.

If you are using the header template tag within your theme, you should see that the canonical url always has the trailing slash.

thanks for this helpful info!