P
P
pevec12017-10-09 00:02:33
Apache HTTP Server
pevec1, 2017-10-09 00:02:33

Convert string to mod_rewrite?

can the string catalog2.php?id=1&type=mod
be turned into a string ^catalog/([-a-zA-Z0-9_]+)/?$
using mod_rewrite?
e.g. catalog/greatwall

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Henry, 2017-10-09
@Henryh

Can.
For example like this:

RewriteRule ^catalog/([^/]+)/?$ catalog2.php?id=$1&type=mod [QSA]

M
Maxim Ivanov, 2017-10-09
@splincodewd

Please rewrite the script then so that you can get car models by key
the user writes catalog/lifan/
php in the browser and receives catalog2.php? type=mod&model_name=lifan as input from apache,
then you don’t need to suffer by id, and the search is by key, not by ID, since you need a CNC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question