Other mod_rewrite problems

Discussion in 'Software' started by marsel martin, 19 May 2010.

  1. marsel martin

    marsel martin What's a Dremel?

    Joined:
    19 May 2010
    Posts:
    1
    Likes Received:
    0
    Hi
    a friend of mine is using e107 on his site and we are having troubles using mod_rewrite. the problem is that we want the forum to have nice urls
    at the moment they look like this http://www.<site>.net/e107_plugins/f...iewforum.php?5
    but we are trying to get mod_rewrite to make them look like
    http://www.<site>.net/forum.php

    but well it dont work it makes the main page of the forum url look like http://www.<site>.net/forum.php but anylinks clicked in the forum keep it at the main page and changes the url to that of the page like http://www.<site>.net/e107_plugins/f...iewforum.php?5

    its probly just something heaps simple we messed up so any ideas guys?
    at the moment the htaccess file looks like this
    Code:

    ErrorDocument 400 /error.php?400
    ErrorDocument 401 /error.php?401
    ErrorDocument 403 /error.php?403
    ErrorDocument 404 /error.php?404
    ErrorDocument 500 /error.php?500

    RewriteEngine on
    RewriteRule forum.php e107_plugins/forum/forum.php
    RewriteRule stats.php e107_plugins/log/stats.php?1
    RewriteRule contact.php e107_plugins/contactform_menu/contactform.php

    <Files articles>
    ForceType application/x-httpd-php
    </Files>
     
  2. thehippoz

    thehippoz What's a Dremel?

    Joined:
    19 Dec 2008
    Posts:
    5,780
    Likes Received:
    174
    we used to run e107 on an old clan forum.. probably best to post this on their forums if they're still around
     
  3. shadows

    shadows What's a Dremel?

    Joined:
    20 May 2010
    Posts:
    107
    Likes Received:
    2
    Mod rewrite are funny ones.

    If you want to hide the .php ext this can be done, so it just reads www.<site>.com/forum/

    RewriteEngine on
    RewriteRule ^forum(\/*)$ e107_plugins/forum/forum.php
    RewriteRule ^stats(\/*)$ e107_plugins/log/stats.php?1 --- What is the ?1 for
    RewriteRule ^contact(\/*)$ e107_plugins/contactform_menu/contactform.php

    The ^ denotes the string to match, the (\/*) allows it to match forum with the forwards/backwards slashes or without the slash at all. The $ denotes end of string to match.

    For the stats page does it take a paramater in the URL like showthread.php?t=188002

    Edit: oops forgot the $ on the ends of the lines.
     
    Last edited: 20 May 2010

Share This Page