SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help!newbie can not start the mod_rewrite function

    am new bie to mod_rewrite and before I can digest the mass of the howto in regular expression, I just want to begin my mod_rewrite function as helloworld, but neither the below setting(all in the root context of httpd.conf) fail, didnt work at all.

    case A:
    LoadModule rewrite_module modules/mod_rewrite.so
    RewriteEngine On
    RewriteRule ^old\.html$ index.html [L]
    RewriteLog /usr/local/apache/apache2.0.44/logs/rewrite.log

    case B:
    LoadModule rewrite_module modules/mod_rewrite.so
    RewriteEngine On
    RewriteRule ^hello\.java\.net\.nl$ http://www.java.net.nl/hello/test.jsp
    RewriteLog /usr/local/apache/apache2.0.44/logs/rewrite.log

    Not only it response nothing(404), but also I found nothing in the rewrite.log,too; but in the access_log, I can found the records as below:

    [05/Apr/2005:23:33:23 -0400] 0 "GET /old.html HTTP/1.1" 404 206 "- -> /old.html"
    192.168.0.11 - - [05/Apr/2005:23:55:43 -0400] 0 "GET / HTTP/1.1" 400 0 "- -> /index.jsp"

    the behind one logged for hello.java.net.nl request, however, seems response by the behind virtualhost setting:
    <VirtualHost 192.168.0.10:80>
    ServerName www.java.net.nl
    DocumentRoot /home/jakarta/tomcat5/webapps/app
    </VirtualHost>
    however, the /index.jsp is existed but do not response,too.(it is not this topic, just skipped)

    I thought the mod_rewirte didnot work at all? am I right?
    what I has not to do but necessary?
    my system is apache2.0.44, all install by one complie, the mod_rewirte inside as default.

    thanks in advance

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,692
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    Z,

    In reading your post, it really seems that you're trying to do things correctly but have tried to use the most difficult process to get there. The best advice I can give you at this point is to read the article at datakoncepts.com/seo which will provide the shortcuts to getting mod_rewrite working AND give you a quick test to verify that it is working properly. Once you get that far, it should be simple to build your regex and do wonderful things with mod_rewrite.

    Regards,

    DK
    Last edited by dklynn; Apr 6, 2005 at 03:41.
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks David, it is my problem to kick start, as long as helloworld build up, I shouldl handle most of the mass by myself.
    ZCoral


Bookmarks

Posting Permissions

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