Making file.php?act=content into content.html using modrewrite?

Discussion in 'Apache' started by EGS, Mar 19, 2008.

  1. #1
    Hello.

    I have a site that is creating links like file.php?act=content_page
    I would like to make links look like content_page.php

    Note that I do not want the underscore and the underscore isn't present in my URLs, I was just using that to show you that content pages are linked like that in that format...

    It's not just index.php?act=content doing it, there are links also like site.php?act=content as well. How can I make these into static .html URLs/links? :confused:

    Thank you for your help.
     
    EGS, Mar 19, 2008 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Bah!!! This one iz so easy only a n00bie wouldn't know how to do it, with that sticky thread!!! :D

    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)\.html$ file.php?act=$1 [L]

    And only a n00bie would have blah.php instead of blah.html if they want it even more search engine friendly!!!! :D:D Now, go make some more crazy polls!!! Like 'When did you last um...have a blood rush??' Or 'Do you have wet dre...' :D
     
    Nintendo, Mar 19, 2008 IP
  3. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #3
    That didn't work!
    When I try going to my site.com/file_name.html it just takes me to main index page!

    I have it for multiple "file.php" including index.php...is this conflicting?
     
    EGS, Mar 26, 2008 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

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

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

    and see if domain.com/wacko.html shows da index page. If that doesn't work, try knocking off da first link. If that still doesn't work...SPAM your web host with a bunch of shart E-mails!! :D:D

    If you're still trying to have da fake URLs be .php, it'll always destroy your index page, until you make da fake URLs unique *cough*.html*cough*!! :D

    Now, where are those new insane threads!!! :D
     
    Nintendo, Mar 26, 2008 IP
  5. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #5
    Why isn't it (*.) or whatever? :confused:
    Modrewrite works on my server fool...so that shouldn't be an issue, I think it may be your coding! :eek:
     
    EGS, Mar 26, 2008 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    If you want it way less secure, (Like spiting out a credit card number on a non https URL :D:D) try (*.) !!!
     
    Nintendo, Mar 26, 2008 IP