• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Apache rewrite rule for tags


Well-known member

I have been using [Tinhte] XenTag until 1.4. Now that 1.5 includes tag funcionality, after importing all the tags from that add-on to XF's own tagging system, I'd like to redirect everything from:

http://www.mysite.com/forums/tags/some+thing -> http://www.mysite.com/forums/tags/some-thing/
http://www.mysite.com/forums/tags/some+thing/ -> http://www.mysite.com/forums/tags/some-thing/

http://www.mysite.com/forums/tags/some+thing+else -> http://www.mysite.com/forums/tags/some-thing-else/
http://www.mysite.com/forums/tags/some+thing+else/ -> http://www.mysite.com/forums/tags/some-thing-else/
Only redirect if after "tags/" there is a plus "+" symbol, otherwise do nothing (because the syntax is the same).

Additionally, a forwarding of the following would be great:
http://www.mysite.com/forums/tags/?t=some+thing -> http://www.mysite.com/forums/tags/some-thing/
http://www.mysite.com/forums/tags/?t=some+thing/ -> http://www.mysite.com/forums/tags/some-thing/
as XenTag also offers a /tags/?t=some+thing linking for special characters.

Jake Bunce

XenForo moderator
Staff member
Off hand, I believe this will require an intermediate PHP script to handle the slug conversion (as opposed to pure rewrite rules).