mod_rewrite .htaccess prob

Discussion in 'Apache' started by sparckyz, Mar 14, 2007.

  1. #1
    I know this sorta thing has been asked many times, and i'v probably read them all, but since i cannot find a solution im going to have to ask.

    I'm with hostgator and know the support mod_rewrite etc..but i cant seem to get it to work on my website.

    I'm trying to get:

    index.php?article=Something-about-something

    to apear as

    Something-about-something.html

    and iv tried everything, then a variation or everything and even the support team at hostgator say it all looks fine and should work. I'v tried:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.+)\.html$ index.php?article=$1
    Code (markup):
    and

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)\.html$ index.php?article=$1 [L]
    Code (markup):
    basically i'm either stumped or stupid :confused: or both.
     
    sparckyz, Mar 14, 2007 IP
  2. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Looks fine to me. I'd suggest enabling rewrite logging to try and see what mod_rewrite is doing or trying to do.

    Just add into the end of your httpd.conf (and restart, obviously):
    RewriteLog /path/to/logfile/to/create.txt
    RewriteLogLevel 5

    Then check the log file and see whats going on. Remember to remove the lines again afterwards otherwise you could end up with gigabytes worth of logs..
     
    rodney88, Mar 14, 2007 IP
  3. sparckyz

    sparckyz Peon

    Messages:
    336
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'v made some progress, this here
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)\.html$ index.php?article=$1
    Code (markup):
    works on my home machine when testing my site and gives the exact result, but on my site (with Hostgator.com) all i get is a "Error 404 page not found". Anyone have any ideas or suggestions?
     
    sparckyz, Mar 15, 2007 IP
  4. sparckyz

    sparckyz Peon

    Messages:
    336
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Additionally..after some reading i think it might have something to do with phpsuexec? Can anyone tell me how to turn this off or at lease a workaround please?
     
    sparckyz, Mar 16, 2007 IP
  5. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #5
    Do a little test.

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^wacko\.html$ index.php [L]

    domain.com/wacko.html should show the index page.
     
    Nintendo, Mar 17, 2007 IP