.htaccess - Redirect dynamic url to static url using htaccess -


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 dynamic names. want redirect dynamic urls following static url.

http://example.com/data.xml 

regards

try:

redirectmatch ^/.+/data.xml$ /data.xml 

or using mod_rewrite:

rewritecond %{request_uri} !^/data.xml$ rewriterule /data.xml$ /data.xml [l,r] 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -