Quick help with a .htaccess please

Discussion in 'PHP' started by bertamus11, Apr 23, 2008.

  1. #1
    Hi there, is there anyone who might understand why this .htaccess is working on my dreamhost account?

    addhandler server-parsed .php
    <Files ~ "^[^\.]+$">
    sethandler application/x-httpd-php
    </Files>
    addhandler application/x-httpd-php .php
    PHP:
    It's supposed to turn my .php files and cetegories into seo .html urls but it doesn't seem to work...

    Anyone have an idea why not?

    Thanks for your help.
     
    bertamus11, Apr 23, 2008 IP
  2. Ikki

    Ikki Peon

    Messages:
    474
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi there,

    Try this:
    AddHandler application/x-httpd-php .php .html .htm
    Code (markup):
    ...or this:
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)\.html$ $1.php [L]
    Code (markup):
    I believe that should do the trick.
     
    Ikki, Apr 23, 2008 IP
  3. bertamus11

    bertamus11 Well-Known Member

    Messages:
    791
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Thanks Ikki, but those didn't work either...
    It's weird as I am on a shared server at dreamhost and every other domain I have there, all of the .htaccess rewrites work except this one. This makes me think t's not a problem with mod rewrite not being turned on... am I right?

    Thanks!
     
    bertamus11, Apr 23, 2008 IP
  4. bertamus11

    bertamus11 Well-Known Member

    Messages:
    791
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    130
    #4
    Here's what the urls should look like if seo is turned on:
    $art_url = $settings['set_seo_onoff'] =='on'
    ? "$root_path/article/".plaintext($row['art_title'])."-$row[art_id]-1.html"
    : "$root_path/articles.php?art_id=$row[art_id]&start=1";

    and what the urls should look like if a category is chosen:
    $cat_url = $settings['set_seo_onoff'] =='on'
    ? "$root_path/category/".plaintext($row['cat_name'])."-$row[cat_id]-1.html"
    : "$root_path/category.php?cat_id=$row[cat_id]";

    Can anyone make an .htaccess out of this? I'm willing to pay if it works! Not a problem :)

    Thanks!
     
    bertamus11, Apr 23, 2008 IP
  5. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #5
    If that .htaccess works in every other domains but not in this one, maybe modifying the "RewriteBase" will solve it :confused:

    What's your old htaccess?
     
    xrvel, Apr 23, 2008 IP