Seeing the URL rejected by mod_rewrite

Posted on 2011-10-08
Last Modified: 2012-05-12
I'm trying to use mod_rewrite statements in .htaccess to block access to a directory of mp3 files.  But the Rewrite_cond statement I have is also blocking the accesses made by an embedded QuickTime player I have  on a page in the directory.  It would be easier to craft a Rewrite_cond statement that would let the player requests through and block browser accesses if I knew what the request from the player  looked like  at the server.  When you put a URL in a browser to access the files the mod_rewrite failure gives you back an error that shows the failing URL,  but when the player makes the access it gets back the failure and then just refuses to come up, without saying anything.  Is there any way I can get Apache to show me the URL from the player that it's rejecting?

Thanks for any ideas.
Question by:steva
    LVL 50

    Accepted Solution

    You have a few options:

    1) The Apache log.  All requests will go here originally, in their unmodified form.  
    2) The rewrite log.  If you light it up, it will show you the original URL, how it is parsed by the various rules, and the final outcome.  Note that this can balloon in size really quickly.
    3) Use a server-side dump page to catch the rejected URL and log it with your own custom application.  It doesn't have to be anything fancy...just a small DB that records origination, URL, etc.

    Author Comment

    Many thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now