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 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    htaccess Redirect Help

    Hi,

    I have a dynamic URL which I have masked.

    This is the clean URL:
    Code:
    http://www.safetyproblemsolutions.com/driver-warehouse-forklift-trucks&a=uk
    The original URL with the query string is:
    Code:
    http://www.safetyproblemsolutions.com/driver-courses.php?action=show&course_url=forklift-trucks&a=uk
    It all works fine. HOWEVER, for something else to work I need that last bit of the query (&a=uk) to become ?a=uk. So basically I need to replace the ampersand with a question mark.

    So the final clean URL becomes:
    Code:
    http://www.safetyproblemsolutions.com/driver-warehouse-forklift-trucks?a=uk
    Here's what I currently have in my htaccess that makes the current magic happen:
    Code:
    RewriteEngine On
    RewriteRule ^driver-warehouse-([^-]*)$ /driver-courses.php?action=show&course_url=$1
    PLEEEEASE can someone help me with this? I need to get this working! Thankyou!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This has nothing to do with PHP, moving to apache configurations.
    Add a QSA flag, that should work fine.

    Edit:
    Wait a minute, this is backwards.
    You don't rewrite to the seo type url, you do it the other way. That &a=uk is they way it is since its been explicitly declared as such somewhere, or passed that way from the browser.
    So this may actually end up being a PHP issue afterall. How are you creating this url in the first place?
    Last edited by Fou-Lu; 03-16-2011 at 08:20 PM.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    Ste9890 (03-18-2011)

  • #3
    New Coder
    Join Date
    Oct 2010
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hi there,

    It's been sorted now, it did just need a QSA flag! Thanks for your help!


  •  

    Posting Permissions

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