Jump to content

Page hangs with simple rewrite rule


play_

Recommended Posts

This is my first attempt at mod_rewrite.

 

What I'm trying to do is make it so that when the user clicks any mp3 link (example, 1.mp3), mod_rewrites redirects that to download.php

 

I this in .htaccess:

 

RewriteEngine on
RewriteRule *.mp3 download.php

 

if I go to http://localhost/1.mp3, the page hangs. Firefox shows the 'loading' sign on the tab, like it's about to load the other page, but it doesn't.

 

any help would be great. thanks ^_^

Link to comment
Share on other sites

What exactly are you trying to do and how exactly did it not work? Using the code I gave you in my previous post if you typed... http://localhost/blah.mp3 ... the the file the user would actually see is http://localhost/download.php?id=blah, but the address bar should remain as the original URL. If that is not what you want then give...

 

a.) what you are typing in the address bar.

b.) what you want the address bar to change to (if at all).

c.) what file you wish to actually be displayed.

Link to comment
Share on other sites

Sorry for not being so clear.

 

What I'm trying to is, i'll have a link. say

<a href="1.mp3">click to download</a>

 

When i click the link, instead of a download dialog popping up or having the file play in the browser, i want the browser to go to download.php

 

What is happening now:

When i click the link:

- page hangs in firefox.

- Chrome plays the mp3 file in browser

Link to comment
Share on other sites

Hmm.. the code I gave previously should work then, I just tested out on my localhost, works fine. Try closing your browser, restarting Apache and trying again, I've had strange issues with .htaccess files before, some kind of strange caching issue.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.