Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2008
    Posts
    77
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Exclamation .htaccess / URL Re-Write / PHP

    Hi!
    I have this line in my .htaccess file which makes a .php file look like a .html

    rewriterule ^contact_us-([^-]+)-([^&]+)\.html$ /contact_us.php?lang=$1&cur=$2&page=$3&url=$4 [L]

    And this page also has a form, which submits to this page itself as:
    contact_us-lang-english-cur-us-page-1-url-emailus.html?do=checkinput

    But it doesn't work ...

    Please help!

    - Xeirus

  • #2
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    At the end of that line you need [QSA,L] as the QSA combines the old and new query strings in the rewrite.
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P

  • Users who have thanked DJCMBear for this post:

    xeirus (10-16-2011)

  • #3
    New Coder
    Join Date
    Aug 2008
    Posts
    77
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by DJCMBear View Post
    At the end of that line you need [QSA,L] as the QSA combines the old and new query strings in the rewrite.
    Thank you very much DJCMBear!
    That worked like a charm !

    Thanks indeed

    - Xeirus

  • #4
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    Not a problem, I am glad I could help
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •