W
W
WQP2015-02-27 13:30:11
Regular Expressions
WQP, 2015-02-27 13:30:11

How to write a regular expression in htaccess?

Hello, I have the code:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_\-]*)\.png$ image.php?user=$1

It works, but I need two parameters, I do this:
RewriteEngine On
RewriteRule ([a-zA-Z0-9_\-])\/([a-zA-Z0-9_\-]*)\.png$ image.php&tanks=$1&user=$2

And the code stops working, how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Petrashevich, 2015-02-27
@WQP

No asterisk in first parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question