Results 1 to 2 of 2
Thread: htaccess rewrite with GET reqs.
-
08-30-2009, 02:34 PM #1Empowering Websites
- Join Date
- Mar 2008
- Location
- UK
- Posts
- 1,135
htaccess rewrite with GET reqs.
Hello, how do I configure my .htaccess rewrite rules to accomodate GET requests?
Currently, /manager/page goes to: ?dept=manager&n=page however, some pages have additional GET reqs, and so this rule doesn't work:
Code:RewriteRule ^([A-Za-z]+)/([A-Za-z]+)$ index.php?dept=$1&n=$2 [QSA]
I am however, trying to change all of these GETs to id to make things easier.Shamil Nunhuck, - Radon Systems Limited
█ VPS + Dedicated Server Hosting and Management
█ vBulletin / XenForo Hosting and Services
█ Server / Website Consultation
-
09-02-2009, 11:46 AM #2Newbie
- Join Date
- Jul 2009
- Posts
- 12
I don't know if you can (or should) use Mod_rewrite to do this. I would just write a PHP script to take those variables in, then issue a
header("Location: /path/to/new/location");
It'd also be wise to use preg_replace to strip out all non alphanumeric characters out of each of the GET parameters (to help prevent improper routing)
Similar Threads
-
.htaccess and mod rewrite
By Skillz in forum Programming DiscussionReplies: 3Last Post: 02-09-2009, 02:30 PM -
htaccess / mod rewrite
By abluegrape in forum Hosting Security and TechnologyReplies: 2Last Post: 06-19-2008, 02:39 AM -
url rewrite with .htaccess
By chamelion in forum Hosting Security and TechnologyReplies: 5Last Post: 03-25-2008, 08:39 PM -
htaccess and mod rewrite
By Bambuk in forum Hosting Security and TechnologyReplies: 1Last Post: 11-05-2006, 01:58 PM -
rewrite using .htaccess
By aawebtools in forum Dedicated ServerReplies: 2Last Post: 05-22-2001, 08:40 AM