.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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -