Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2004
    Posts
    201
    Thanks
    8
    Thanked 1 Time in 1 Post

    rewrite little fix ?

    hey im just starting to learn about mod_rewrite and so far i came up with this:

    PHP Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule File
    /(.*).htmluploadedfileshere/$
    I want to be able to enter:

    File/billing.zip.html

    and it will go to a directory called

    uploadedfileshere/billing.zip

    which it does do, but when downloading billing.zip, it seems to be called billing.zip.html. How can I tell the code that I dont want the .html part to be added?


    Thanks

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    256
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The first thing I notice is that the period in .html$ ought to be escaped with a backslash, like this:

    PHP Code:
    RewriteRule File/(.*).htmluploadedfileshere/$
    See if that makes any difference.

    [edit] OK... so the backslash does not seem to appear on the page. It should be positioned between the closing bracket and the period. Press "quote" to see it.

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Posts
    201
    Thanks
    8
    Thanked 1 Time in 1 Post
    Thanks for the reply, didnt think I was going to get one.

    I pressed quote and copied the code you wrote but i think I already tried that; but ethierway it didnt work. You can try yourself here:

    http://temp.platinumhost.co.uk/rewri...lling.zip.html

    Thanks for your time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •