Jump to content

Trailing Slash In Friendly Url's

Featured Replies

Posted

Before I go digging into code, I thought I would ask in case its a setting I'm missing.

Is there a way to eliminate the trailing slash on the friendly url's generated?

  • Author

Ok, I did the digging since nobody could give me an answer.

It's hard coded into core, which is kind of silly. Trailing slashes don't look clean IMO.

  • 6 months later...

Hey Kevin, I was trying to do this same thing.

I found /forum/system/Http/Url.php and removed the / in $trailingSlash = mb_strpos( $definition['friendly'], '.' ) !== FALSE ? '' : '/'; on line 629.

It seems to work. Is this what you did? Also I can't figure out how to remove it from the board index, were you able to?

Edited by Joe Collins

  • Author

Hey Kevin, I was trying to do this same thing.

I found /forum/system/Http/Url.php and removed the / in $trailingSlash = mb_strpos( $definition['friendly'], '.' ) !== FALSE ? '' : '/'; on line 629.

It seems to work. Is this what you did? Also I can't figure out how to remove it from the board index, were you able to?

Yes. I wrote a simple plugin to fix it without modifying core files.

https://community.invisionpower.com/files/file/7232-fix-furl-slash/

Thanks for making that. Do you know if it's possible to remove the slash from yourdomain.com/forum/ as well?

  • Author

That plugin should remove it from all urls generated by the suite

Thanks a bunch. :) Downloaded!

  • 1 year later...

Thanks for this plugin, Kevin, that was exactly what I was looking for! :D

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.