+ Reply to Thread
Results 1 to 5 of 5

Thread: Mod Rewrite Help

  1. #1
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Mod Rewrite Help

    Code:
    RewriteEngine on
    RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/([0-9]+)/$ index.php?x=$1&y=$2&id=$3
    RewriteRule ^verificationimage.png$ FileLibrary/imgVerification.php
    RewriteRule ^([a-zA-Z]+)/user/([0-9]+)/$ index.php?x=$1&user=$2
    RewriteRule ^([a-zA-Z]+)/([0-9]+)/$ index.php?x=$1&membPage=$2
    RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/$ index.php?x=$1&y=$2
    RewriteRule ^header_image.png$ FileLibrary/header_img.php
    RewriteRule ^([a-zA-Z]+)/([0-9]+)/$ index.php?x=$1&id=$2
    RewriteRule ^([a-zA-Z]+)/$ index.php?x=$1
    RewriteRule ^rss.xml$ rss.php
    Alright, when I try to go to members/user/My ID/ it doesn't show the profile but instead, it shows the main users listing. Any help with this?

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Mod Rewrite Help

    When you go to "members/user/My ID/", what's the resulting URL? You'll probably have to print it out within index.php.

    The RewriteRule flags might have something to offer. For instance, the L flag will stop rewrite processing when a URL matches a rule (one of the other rules might be causing problems).

    You can see what luck you have with Martin Melin's RewriteRule tester.

    This won't help with this problem, but the 0-or-1-quantifier ("?") will let your RewriteRule match URLs that don't have a trailing "/" (e.g. try the pattern "^([a-zA-Z]+)/?$")

  3. #3
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Re: Mod Rewrite Help

    When I go to members/user/1/ it assumes that 1 is an ID instead of a user because of the rule at the very top.

  4. #4
    mfurqanabid's Avatar
    mfurqanabid is offline x10Hosting Member mfurqanabid is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    37

    Re: Mod Rewrite Help

    use [L] after the ReWrite Condition. for more information visit this url

    http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
    Muhammad Furqan

    Visit knowledge Hut for programming help.

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Mod Rewrite Help

    Put the more specific rule (the one with the "^([a-zA-Z]+)/user/([0-9]+)/?$" pattern) before the more general rule. Use the [L]ast flag as an optimization (it probably won't help with correctness).

+ Reply to Thread

Similar Threads

  1. [REQ][2000 credits]Install Nginx and fix the url rewrite
    By galaxyAbstractor in forum The Marketplace
    Replies: 0
    Last Post: 09-27-2008, 03:35 AM
  2. Mod rewrite
    By AsianX in forum Free Hosting
    Replies: 3
    Last Post: 09-11-2008, 05:37 PM
  3. punbb error ... is mod rewrite off
    By SuperMAG in forum Free Hosting
    Replies: 2
    Last Post: 03-10-2008, 04:47 PM
  4. ReWrite Module is not active
    By rkaraca in forum Free Hosting
    Replies: 8
    Last Post: 10-25-2006, 06:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers