mod_rewrite: passing arguments as well.

mod_rewrite: passing arguments as well.

Post by Vict » Sat, 25 May 2002 03:09:45



I want this url:

http://mysite.com/5.html => http://mysite.com/page.php?page=5

And this too must work:

http://mysite.com/5.html?foo=bar => http://mysite.com/page.php?page=5&foo=bar

How can I write that rule?

RewriteRule ^([0-9].*).html?(.*)$ page.php?page=$1&$2

doesn't quite work.

Thanks in advance,
Victor


 
 
 

mod_rewrite: passing arguments as well.

Post by Joshua Sliv » Sat, 25 May 2002 05:12:13



> I want this url:
> http://mysite.com/5.html => http://mysite.com/page.php?page=5
> And this too must work:
> http://mysite.com/5.html?foo=bar => http://mysite.com/page.php?page=5&foo=bar
> How can I write that rule?

Try this:

RewriteRule ^([0-9].*).html$ page.php?page=$1 [QSA]

 
 
 

mod_rewrite: passing arguments as well.

Post by Vict » Sat, 25 May 2002 14:23:08


Quote:> > How can I write that rule?

> Try this:

> RewriteRule ^([0-9].*).html$ page.php?page=$1 [QSA]

It works perfectly. Thanks a lot mate!

// Victor

 
 
 

1. script questions - passing argument as argument to another program

Hello.

I have a script that I want to take an argument and pass it to the
passwd program.

1.  How in any situation do I take an argument in a script and pass it
to a program?  I can type the command in like: passwd $1 , but I do
not know how to simulate the enter key being pressed at that point.

2.  How do I allow other users to run this script?  I want the script
itself to execute as root when run since there are commands only root
may run, and I will only give other people in a certain group the
ability to execute the script.

3.  Is there a way to associate a file with multiple groups?

Thank you for your time.

Andrew

please remove 'REMOVE' characters to e-mail me

2. IP alias doesn't work

3. How to pass arguments passed in ''s

4. Need help installing gcc 2.2.2d pl7

5. mod_rewrite with arguments

6. Who can help me ??????

7. Invalid argument: mod_rewrite: Could not set permissions

8. Problems setting APOP for Qpopper

9. passing PATH_INFO to PHP script with mod_rewrite

10. Passing Arguments

11. Passing arguments from the form via BASH script

12. passing awk variables as arguments

13. passing arguments to an alias