www.webdeveloper.com
Results 1 to 7 of 7

Thread: .htaccess RewriteEngine

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    22

    Arrow .htaccess RewriteEngine

    Dear All,
    Please help me to fix this I am new to RewriteEngine Rules

    I have a WHOIS Lookup Script on my website
    The URL is http://whois.domain.com/whois.php?domain=example.com

    Now I need to achieve this http://whois.domain.com/example.com

    So I wrote

    RewriteEngine On
    RewriteRule ^([\w\-]*)$ whois.php?domain=$1

    In the above code I am not getting the domain extension passed, I know the code is wrong, but dont know where.

    Please HELP.

  2. #2
    Join Date
    Dec 2008
    Posts
    13
    You forgot to match the point. Plus "\w" will not match numbers and other weird characters.
    Try this instead (not tested):

    RewriteRule ^([a-z0-9\-\._]+\.[a-z]+)$ whois.php?domain=$1

  3. #3
    Join Date
    Jun 2008
    Posts
    22
    When I use
    RewriteRule ^([a-z0-9\-\._]+\.[a-z]+)$ whois.php?domain=$1
    I get an ERROR

    Sorry, that tld is not supported.

    ------------------------------------------------------------

    But, If I delete the .htaccess and use the below URL it works fine

    http://whois.domain.com/whois.php?domain=example.com

  4. #4
    Join Date
    Dec 2008
    Posts
    13
    Hmm I don't really see anything wrong on first sight...

    Could you post the TLD that gave the error?

  5. #5
    Join Date
    Jun 2008
    Posts
    22
    I just tried with demo.com

  6. #6
    Join Date
    Jun 2008
    Posts
    22
    Please Help When I use

    RewriteRule ^([a-z0-9\-\._]+\.[a-z]+)$ whois.php?domain=$1

    I get an ERROR

    Sorry, that tld is not supported.

  7. #7
    Join Date
    Jun 2008
    Posts
    22
    Please Help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles