XF 1.2 URL routing help

dvsDave

Well-known member
crud. Regex/mod rewrite is not my forte.

I have no idea how take an already canonical URL and make it un-canonical.
 

dvsDave

Well-known member
Sigh... Here's what I've got, but I know it's not working:

Code:
RewriteRule /wiki/([A-Za-z0-9-]+)$  wiki/?title=$1 [NC,R=301]
 

Jeremy

Well-known member
I expect a lot of people do. I'm slightly distracted, but I don't want to write RegEx without my regexpal.com up to see how it'll interact.
 

Jake Bunce

XenForo moderator
Staff member
Old URL:

http://www.controlbooth.com/wiki/Safety

Current URL

http://www.controlbooth.com/wiki/?title=Safety

Google is screaming bloody murder that the old URL's aren't working. The question I have is, would it be better to use route filters to point google in the right direction, or to use mod rewrite to make the new URL's look like the old ones?
Put this at the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteRule ^wiki/(.+)$ /wiki/?title=$1 [R=301,L]
That should do it.
 
Top