Can you help me write some .htaccess for switching how something is called?

Discussion in 'Apache' started by Pros, Jan 10, 2010.

Thread Status:
Not open for further replies.
  1. #1
    I tried to describe it as best I could in English in the title, but here is what I am looking for some code to do. I hope you can help me:

    The script currently calls like this: root.com/?b=this+plus+sign+separates&g=1

    the &g=1 doesn't always get called, and if it is called, only occurs in that fashion, so there is no &g=2, etc

    I would like .htaccess that would rewrite the URLs so they could be called like this also:

    root.com/this+plus+sign+separates/g/

    I'd like g/ to be added for functionality, so like &g=1, it is not added to every URL, but if someone were to type it, it would be a replacement for &g=1.

    I'd like the trailing slash to be appended, but it to work without it.

    For example, here is a tutorial I found for another project about how to rewrite extensions to use directory form:

    http://eisabainyo.net/weblog/2007/08/19/removing-file-extension-via-htaccess/

    I want it to work like the code with trailing slash, where it can be called either way.

    Please, let me know if I have been unclear in any way, or if you can help me with a solution.

    Thank you.
     
    Pros, Jan 10, 2010 IP
Thread Status:
Not open for further replies.