Please help with this htaccess code (like WP)

Discussion in 'Apache' started by JEET, Oct 19, 2010.

  1. #1
    Hello,
    Could someone please help me with a .htaccess rule for this?

    I want "domain.com/page_title" to load the page at "domain.com/?title=page_title"
    If possible, the .htaccess code should not have "domain.com" in it, so that I can use it on multiple sites without modifying the code.
    Also there are other rules like:
    
    RewriteRule page_(.+).html$ index.php?page=$1 [L]
    
    Code (markup):
    and this new rule should not clash with any existing rule.
    Could someone help please?
    Thanks :)
     
    JEET, Oct 19, 2010 IP
  2. scriptinstaller

    scriptinstaller Peon

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    domain.com/page_title
    domain.com/?title=page_title

    Your site is missing format, not sure why people making things more difficult on themselves :D
    Why skip index.php or index.cgi or whatever it is?

    Does this page_title have an extension?

    So far its going to be hard to decipher, best i have is this
    RewriteRule ^(.*?)_(.*?).html$ /index.php?title=$1_$2 [R=301,L]

    This would obviously match anything in the root directory there that is a html file with a _ in it
    replace the index.php with whatever is the default loading page file for your site..

    if you dont have .html files or these are directories, all i can suggest is adding al ine for each one you know about :D
     
    scriptinstaller, Oct 24, 2010 IP