Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003

    Unanswered: find out browser url using php

    I want to run a script on my webpage that does something like:

    if browser URL = { do task1 }
    if browser URL = { do task2 }

    I remember seeing this somewhere about a year ago but now I can't find that php function. Was it header?

  2. #2
    Join Date
    Sep 2005
    $PHP_SELF will get the url

  3. #3
    Join Date
    Feb 2004
    If you have an Apache web server with mod rewrite available then you can use this method.
    More info at

    All you need to do is create or modify a file called .htaccess located in the root directory of your site and add the following lines, change to match your domain.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
    RewriteRule ^(.*)$$1 [R=301,L]


Posting Permissions

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