Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Let Textpattern accept URLs with trailing slash?
Ok but how do I “internally remove” trailing slashes? Are you referring to mod_rewrite or are you recommending to use the /title URL scheme and refrain from using trailing slashes when linking to individual articles?
Offline
Re: Let Textpattern accept URLs with trailing slash?
Do I understand correctly: No longer use R=301 in mod_rewrite in order to not change the address bar, learn how to remove trailing slashes in mod_rewrite (“internally”), and use canonical links in order to prevent getting the content rated as duplicate (because we are no longer using R=301)?
Last edited by ar (2021-01-20 22:58:38)
Offline
Re: Let Textpattern accept URLs with trailing slash?
ar wrote #328287:
Ok but how do I “internally remove” trailing slashes?
With something like
RewriteRule ^(.*)/$ /$1 [L]
but many sites explain it much better than me.
Are you referring to mod_rewrite or are you recommending to use the /title URL scheme and refrain from using trailing slashes when linking to individual articles?
Both should work, just remove the slash-adding rule from your .htaccess
to try.
Offline
Re: Let Textpattern accept URLs with trailing slash?
ar wrote #328288:
Do I understand correctly: No longer use R=301 in mod_rewrite in order to not change the address bar, learn how to remove trailing slashes in mod_rewrite (“internally”), and use canonical links in order to prevent getting the content rated as duplicate (because we are no longer using R=301)?
Quite right imo, but I may be wrong.
Offline
Re: Let Textpattern accept URLs with trailing slash?
Thank you very much, I will try it out. :-)
Offline
Re: Let Textpattern accept URLs with trailing slash?
ar wrote #328282:
Ok I guess that my “messy” page code is the best I can do in this case:
- Deliver a specific ID as front page article (in my example id=2)
Check github.com/colak/neme/blob/master/pages/about.tpl#L200 and github.com/colak/neme/blob/master/forms/search_results.tpl#L5
- Deliver specific articles as “landing page” by assigning a “landingpage”-category (in my example called “overview”) when URL is /section
github.com/colak/neme/blob/master/pages/projects.tpl#L204
- Deliver everything else as regular articles but have the need to use /section/article URL.
If you have the section/category/title url pattern, this will not be possible, but it is possible if you use the section/title one.
There was a big discussion some time ago about how these url patterns should work. In my view, if you use categories, they should be reflected in the site’s tree so
- /products/
- /products/paints/
- /products/paints/acrylic
makes a semantic sense but
- /products/acrylic
does not as acrylic could refer to something which might not be a paint.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline