This is a discussion on Variable no of GET elements within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, How could I configure the htaccess file to do: test.html?var1=test ---> test.php?var1=test AND ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
How could I configure the htaccess file to do: test.html?var1=test ---> test.php?var1=test AND test.html?var1=test&var2=test&var3=test -->test.php? var1=test&var2=test&var3=test In short - passing a variable number of GET elements to the new file whilst rewrite is on. Many thanks A |
|
|||
|
On Jun 24, 9:16*am, UKuser <spiderc...@yahoo.co.uk> wrote:
> Hi, > > How could I configure the htaccess file to do: > > test.html?var1=test ---> test.php?var1=test > AND > test.html?var1=test&var2=test&var3=test -->test.php? > var1=test&var2=test&var3=test > In short - passing a variable number of GET elements to the new file > whilst rewrite is on. All you need is the `QSA` flag in RewriteRule, say in your .htaccess: RewriteEngine On RewriteBase / RewriteRule ^test.html$ test.php [QSA,L,PT] [untested] lihao |
|
|||
|
On Jun 24, 2:43*pm, "lihao0...@gmail.com" <lihao0...@gmail.com> wrote:
> On Jun 24, 9:16*am, UKuser <spiderc...@yahoo.co.uk> wrote: > > > Hi, > > > How could I configure the htaccess file to do: > > > test.html?var1=test ---> test.php?var1=test > > AND > > test.html?var1=test&var2=test&var3=test -->test.php? > > var1=test&var2=test&var3=test > > In short - passing a variable number of GET elements to the new file > > whilst rewrite is on. > > All you need is the `QSA` flag in RewriteRule, say in your .htaccess: > > RewriteEngine On > RewriteBase / > RewriteRule ^test.html$ test.php [QSA,L,PT] > > [untested] > > lihao Great thanks for your help! (the RewriteBase / caused an issue but without it - was great) |