0

I have following type of dynamic urls.

http://example.com/interviews/sample1/data.xml
http://example.com/interviews/sample1234/data.xml
http://example.com/video/video-2/data.xml

In here interviews, sample1, sample1234, video, video-2...etc are dynamic names. I want to redirect those dynamic urls to following static url.

http://example.com/data.xml

Regards

4

1 回答 1

2

尝试:

RedirectMatch ^/.+/data.xml$ /data.xml

或使用 mod_rewrite:

RewriteCond %{REQUEST_URI} !^/data.xml$
RewriteRule /data.xml$ /data.xml [L,R]
于 2013-05-21T07:48:41.927 回答