Rewrite Help

Discussion in 'Apache' started by mg3hockey, Apr 11, 2010.

  1. #1
    Hey guys,

    I am having a slight problem.

    I am trying to post articles to my website now and when I post them I want the name of the article to be the URL

    Right now it is
    mysite.org/page/2.html

    Instead I would like it to be
    mysite.org/article-title

    And in the .htaccess here is what is listed for page
    RewriteRule ^page/([0-9]+)\.html$ page.php?p=$1

    Any thoughts?

    Thanks!
     
    mg3hockey, Apr 11, 2010 IP
  2. mg3hockey

    mg3hockey Active Member

    Messages:
    438
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    I looked through the internal script in the admin panel and there was no way to change the configurations in there...so the only way to do it would be through the .htaccess

    thank you so much in advance!
     
    mg3hockey, Apr 12, 2010 IP
  3. coffear

    coffear Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Not only will you need to create the mod_rewrite rules in a .htaccess file but you will also change the links within the pages themselves so that they are outputting the clean url's. Mod_rewrite does not rewrite the URL's that are output, it simply rewrites the incoming traffic.
     
    coffear, Apr 13, 2010 IP