Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2010-04-12 12:16:57
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Formatting Question: Trailing Slash
Is there a way to make it so that when permanent link mode is set to /title —- you have it with a trailing slash — /title/
So instead of this:
http://textpattern.com/for-site-designers
I got this: http://textpattern.com/for-site-designers/
I would like to do this within textpattern if possible and not have to modify the htaccess file.
Thanks.
Offline
Re: Formatting Question: Trailing Slash
Might be a daft question, but, ummm why? From what I can recall, the act of adding a trailing slash to a non-directory just means more trips back and forth to the server as it tries to untangle what you mean. Adding one to a true directory is a good thing because it reduces the requests by one and gives the server less to do.
Things might have changed since I last looked. A few articles seem to support adding slashes arbitrarily to all links. I can see the reason for the about.php thing, but TXP doesn’t use that. And for future-proofing a site, you’re not likely to reorganise your site and decide that the article entitled ‘smash-the-face-off-my-penguin’ is to become a directory in future!
That said, I can only think of either using gbp_permanent_links or a redirect in htaccess to rewrite the rule with a trailing slash if one isn’t present. It’ll slow your site down though as it has to parse the rule and apply the redirect/alteration. Also, be careful for inadvertently creating never-ending loops where your server adds the slash and the browser (or some later script) goes “umm, that’s not a directory, try again”.
Last edited by Bloke (2010-04-12 13:03:02)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Pages: 1