Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a problem with a link in a newsletter. The link point to a file (.wav) who is on the server but when I click on it on the newsletter I got an http 400 error, which means the file is missing. But it is on my server.

I've tried to make a redirection to another file (.zip) The redirection doesn't work but I can download the file.

My file is called like that: trak(Extended_Intro+Outro).wav

and the zip is: track.zip

My htaccess looks like that:

AddType audio/x-wav .wav
AddType audio /wav .Wav
AddType application/octet-stream .wav

Redirect 301 /newsletter/music/track(Extended_Intro+Outro).wav 

http://mysite/newsletter/music/track.zip

What I am doing wrong?

Thanks for help.

Regards

share|improve this question

migrated from stackoverflow.com Sep 13 '11 at 22:04

This question came from our site for professional and enthusiast programmers.

2  
http 400 is actually "bad request" –  Cyclone Sep 13 '11 at 21:53
2  
I think the formatting of your AddType is wrong: remove the excess spacing on the second line. –  U4iK_HaZe Sep 13 '11 at 22:27
    
@U4ik_Haze: yes, that "audio /wav" is wrong. should be "audio/wav". –  cas Sep 14 '11 at 9:44

1 Answer 1

i'm having a hard time trying to figure out what it is you're actually trying to do.

you want to redirect a request for a specific .wav file to a specific .zip file? or the other way around?

in either case, why? they're different types of files, not really interchangable.

As for the htaccess problem, do you have:

  • AccessFileName defined in your apache config?

see: http://httpd.apache.org/docs/2.2/mod/core.html#accessfilename and http://httpd.apache.org/docs/2.2/howto/htaccess.html

  • AllowOverride configured for the directory concerned?

    You need FileInfo allowed for AddType and Redirect to work in a .htaccess file.

    Watch our for "AllowOverride None" in a higher level dir - that disables htaccess settings for the directory and all subdirectories (but will be overridden by more specific AllowOverride rules that are defined for subdirectories)

see http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

share|improve this answer
    
Thanks for reply. I've updated the htaccess without the space but it doesn't anything unfortunately. Regards –  user94598 Sep 13 '11 at 22:48
    
what's a space got to do with anything i wrote? –  cas Sep 13 '11 at 23:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.