I am trying to do what should be a simple rewrite.
I want
'www.somedomain.com/anyword'
to be rewritten as
'www.somedomain.com/GeneratePage?menu=anyword'
Here is my rewrite configuration:-
- Code: Select all
RewriteEngine on
RewriteRule ^(.*)$ GeneratePage.php?menu=$1 [NC,L]
The rewrite works up to a point, but the '?menu=$1' part gets stripped off, so Generate.php (without any query string) is served.
Here is an extract from the rewrite.log. I have taken out the host information and added line numbers
1..(2) init rewrite engine with requested uri /WorkBench
2..(3) applying pattern '^/(.*)$' to uri '/WorkBench'
3..(2) rewrite '/WorkBench' -> '/GeneratePage.php?menu=WorkBench'
4..(3) split uri=/GeneratePage.php?menu=WorkBench -> uri=/GeneratePage.php, args=menu=WorkBench
5..(2) local path result: /GeneratePage.php
6..(2) prefixed with document_root to DocumentRoot/GeneratePage.php
7..(1) go-ahead with DocumentRoot/GeneratePage.php [OK]
All seems to be well until line 4 when the string "?menu=WorkBench" is split off.
I have tried this with different flags and different patterns but it won't work. What have I done wrong?
Thanks, Robbie