Answer the question
In order to leave comments, you need to log in
How to pull 2 GET variables when using CNC?
Such a disaster. I took up this difficult task, which is called cnc, and ran into the following problem:
there is a code in .htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [ R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^gorod/(.*)$ city.php?city=$1 [L]
RewriteRule ^gorod/(.*)/ (.*)$ search.php?city=$1&value=$2 [L]
In the case of RewriteRule ^gorod/(.*)$ city.php?city=$1 [L] - everything works out clearly, I pull out the $_GET[ 'city'] and happy (I'm pulling out the city conditionally moskva ) !
But with RewriteRule ^gorod/(.*)/(.*)$ search.php?city=$1&value=$2 [L] - it doesn't work, it puts both variables into the $_GET['city'] variable, it does not break (it turns out something like: moskva/pememennaya2 ), and the second variable generally turns out to be not. What to do?
Answer the question
In order to leave comments, you need to log in
RewriteRule ^gorod/([^/]*)/(.*)$ search.php?city=$1&value=$2 [L]
The problem is gone. Both options helped in the aggregate, it did not work separately! Thank you!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question