开发者

agh - mod_rewrite remove '-xxx-XXX' from URL

开发者 https://www.devze.com 2023-01-10 17:34 出处:网络
bit of a nightmare. Clients sent out a big email with in links in them which have subsequently changed!

bit of a nightmare. Clients sent out a big email with in links in them which have subsequently changed!

just need to change开发者_开发问答

forthcoming-events/event/skills-xxx-XXX

to

forthcoming-events/event/skills

so just removing the '-xxx-XXX'. Any help majorly appreciated as struggling to find a solution.


I'd have thought that something like:

RewriteRule \A/forthcoming-events/event/skills-xxx-XXX/*$       /forthcoming-events/event/skills/$1         [L]

...would do the trick. (That said, I've presumed that the "skills-..." bit is a directory.


RewriteRule ^(.*)-xxx-XXX$ $1 [R=302,NC]

the above works to match the rewrite the URLs!

cheers...

0

精彩评论

暂无评论...
验证码 换一张
取 消