Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2008
    Posts
    606

    how to rewrite this url ?

    how can i rewrite

    Code:
        www.mysite.com/someURLhere
    into

    Code:
        www.mysite.com/ping.php?url=someURLhere

    without mistaking local files, and directories as domains.

    so i dont want

    Code:
        www.mysite.com/index.php 
        www.mysite.com/admin/
    to rewrite to

    Code:
        www.mysite.com/ping.php?url=index.php
        www.mysite.com/ping.php?url=admin/

  2. #2
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Use below. Make sure you create a file ping.php inside the document root.
    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^(.*)$ /ping.php?url=$1 [R=301,L]
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

Similar Threads

  1. apache rewrite ==> lighttpd rewrite HELP
    By moonswamp in forum Hosting Security and Technology
    Replies: 0
    Last Post: 07-24-2008, 07:59 PM
  2. apache rewrite ==> lighttpd rewrite HELP
    By Woooo in forum Hosting Security and Technology
    Replies: 9
    Last Post: 06-24-2008, 01:07 PM
  3. how do i use mod rewrite for this?
    By d3nnis in forum Programming Discussion
    Replies: 5
    Last Post: 11-29-2004, 02:45 AM
  4. Need some Rewrite help
    By HeadlineNews in forum Hosting Security and Technology
    Replies: 0
    Last Post: 10-13-2004, 12:06 PM
  5. mod rewrite 404 to 200
    By stewartrose in forum Hosting Security and Technology
    Replies: 1
    Last Post: 10-10-2004, 02:35 AM

Posting Permissions

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