mod_rewrite and $_SERVER['PHP_SELF']

Posted on 2009-02-23
Last Modified: 2012-05-06
Hi All

I am using mod_rewrite to rewrite my url's. However, when I call $_SERVER['PHP_SELF'] it gives the actual page, and not the rewritten page. Is there any way I can get the rewritten pages instead?

i.e. is rewritten as

Is there anyway I can get the "/1/Listing.php" instead of "view.php" returned?

Question by:leapingleon
    LVL 14

    Accepted Solution

    with $_SERVER['REQUEST_URI']

    Author Comment

    Sometimes my laziness amazes even me. This forum just makes life too easy sometimes.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    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!

    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    759 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

    9 Experts available now in Live!

    Get 1:1 Help Now