Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm looking for a way to convert this type of url : h11p://www.mywebsite.com/dl/F5EGD6 Into h11p://www.mywebsie.com/dl/files/my_file.zip sing a PHP page to request the URL from the DB with F5EGD6. I tried ith this htaccess file :

RewriteEngine on
RewriteRule (*)$ /dl.php [QSA]

But it doesnt work, I get Error 500 :(

I don't know how to handle that...

Anyone know?

share|improve this question
    
You should check out any of the many mod_rewrite tutorials out there. They explain how to do this quite well. –  John Conde Oct 23 '10 at 3:10
    
Thank you very much John :) –  Jeremy Dicaire Oct 23 '10 at 3:21
    
Is h11p a typo? Twice? –  Thomas Oct 23 '10 at 3:53
    
LOL I'm not alowed to put links since I don't have many reputation points :) –  Jeremy Dicaire Oct 23 '10 at 16:28

1 Answer 1

up vote 1 down vote accepted

if i were going to transform h11p://www.mywebsite.com/dl/files/zip.zip into h11p://www.mywebsite.com/dl.php?what=zip.zip

i would do something like

RewriteRule ^dl/files/(.*)$ dl.php?what=$1

that matches h11p://www.mywebsite.com/dl/files/anythinghereincludingslash/ and would transform it into h11p://www.mywebsite.com/dl.php?what=anythinghereincludingslash/

I think thats probably what you're looking for.

N.B. ModRewrite would need to be enabled.

**Again with hyperlinks and being a new user here. You know what i mean.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.