Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2008

    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:

    RewriteRule ^([A-Za-z]+)/([A-Za-z]+)$ index.php?dept=$1&n=$2 [QSA]
    I require: ?dept=manager&n=page&id&etc=etc to go to: /manager/page/id/5/etc/6 however, not all pages present the same method of id input, IE. some pages used id, others catid, and others, bugid, so it's a bit difficult.

    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

  2. #2
    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

  1. .htaccess and mod rewrite
    By Skillz in forum Programming Discussion
    Replies: 3
    Last Post: 02-09-2009, 02:30 PM
  2. htaccess / mod rewrite
    By abluegrape in forum Hosting Security and Technology
    Replies: 2
    Last Post: 06-19-2008, 02:39 AM
  3. url rewrite with .htaccess
    By chamelion in forum Hosting Security and Technology
    Replies: 5
    Last Post: 03-25-2008, 08:39 PM
  4. htaccess and mod rewrite
    By Bambuk in forum Hosting Security and Technology
    Replies: 1
    Last Post: 11-05-2006, 01:58 PM
  5. rewrite using .htaccess
    By aawebtools in forum Dedicated Server
    Replies: 2
    Last Post: 05-22-2001, 08:40 AM

Posting Permissions

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