XF 2.3 How to properly use route filter wild cards?

electrogypsy

Well-known member
Hey there, I'm trying to figure out how to use wild cards in XF's route filters. The documentation doesn't really give a good example so I'm hoping some users can post some?

I'm toying around with wildcards to see if 'discourse style' urls are possible for threads. For example, changing:

mysite.com/threads/thread-title.1234

to

mysite.com/t/thread-title/1234

it seems like searching for:

threads/{name}.{name.digit}

and replacing with:

t/{name}/{name.digit}

might logically do the trick, but it doesn't seem to work. maybe it's not possible (which is fine) but im just curious to see some examples of wild cards in use so I can better understand how those work.

thanks in advance for any help you can provide!
 
This is possible, but you're looking in the wrong area.

I believe these URLs are changeable in Development Mode, if I recall correctly, as I've done ####-thread-title (or something similar).

The variables on the correct setting page will look more like {str:name} and {int:id} though. Moving them around could accomplish what you're trying to do here.

One caveat to that though is if you ever upgrade, you will lose those changes, so you'll need to take note of each URL and apply it to an upgraded dev instance first to see if it works. And, if it can't, you'll need to do URL rewrites to those to not lose SERP for those threads/other items.
 
Back
Top Bottom