开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜