Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts

    how to use the apache's Mod_Rewrite?

    Hi;
    I am testing for how to use the Apaches's Mod_Rewrite for user submit their new thread like this forum does.

    The following are my result from my test.
    Not Found
    The requested URL /tutorials/13/0.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.




    I am hosting at the movement. And i have put the Rewrite rule to the .htaccess file as following;
    RewriteRule ^tutorials/(.*)/(.*).php /tutorials.php?req=tutorial&tut_id=$1&page=$2

    and in my post.php file, the code as following;

    PHP Code:
    <html>
    <
    body>

    <
    form [B]action="http://www.forum.me.com/tutorials/13/0.php" [/B]method="post">
    Name: <input type="text" name="name" />
    Age: <input type="text" name="age" />
    <
    input type="submit" />
    </
    form>

    </
    body>
    </
    html
    But when i click the submit button, it bring out the above result which i have highlighted to me.

    1) Could you tell me what i have done wrong?
    2) how to set up a new page with some content for the "http://www.forum.me.com//tutprials.php?req=tutorial&tut_id=13&page=0"


    Thanks

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    I think you should remove the tags to start with?

    bazz

  • #3
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    this isnt PHP can a mod move to General Web Building

  • #4
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    > I think you should remove the tags to start with?

    Hi bazz;
    Could you specify out which tags? Thanks

  • #5
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    >this isnt PHP can a mod move to General Web Building

    Hi rafiki;

    I don't think so, who write the code for user submit their thread?

  • #6
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't think the problem is related to the php if you are getting a 404 error when it tries to find the page.

    Here is what i think should be inside the .htaccess file.

    Code:
    RewriteEngine on
    Options +FollowSymlinks
    
    RewriteRule ^tutorials/(.*)/(.*).php tutorials.php?req=tutorial&tut_id=$1&page=$2 [L]
    I think that should work... let me know if you still have problems, also make sure the .htaccess file is inside the right directory.

  • #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Quote Originally Posted by kamkam View Post
    Hi bazz;
    Could you specify out which tags? Thanks
    Not sure why they didn;t show up but I emant the [ b] [ / b ] tags in the forst line of the form.

    bazz

  • #8
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    That's ok, bazz. Thanks anyway.


  •  

    Posting Permissions

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