Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-16-2011, 07:22 PM   PM User | #1
Ste9890
New Coder

 
Join Date: Oct 2010
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Ste9890 is an unknown quantity at this point
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!
Ste9890 is offline   Reply With Quote
Old 03-16-2011, 08:16 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,647
Thanks: 4
Thanked 2,450 Times in 2,419 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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?
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php

Last edited by Fou-Lu; 03-16-2011 at 08:20 PM..
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
Ste9890 (03-18-2011)
Old 03-18-2011, 06:20 PM   PM User | #3
Ste9890
New Coder

 
Join Date: Oct 2010
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Ste9890 is an unknown quantity at this point
Hi there,

It's been sorted now, it did just need a QSA flag! Thanks for your help!
Ste9890 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:45 PM.


Advertisement
Log in to turn off these ads.