Answer the question
In order to leave comments, you need to log in
Problem with the third CNC parameter, why doesn't it read $_GET?
The problem is this: it doesn't read $_GET['next'] and it's not at all clear why. At first everything seemed to work, but then it broke again. $_GET['next'] is the third parameter, the other two work as they should, but this one resists...
.htaccess looks like this:
RewriteRule ^([-a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/$ page.php?main=$1&sub=$2&next=$3 [QSA,L]
RewriteRule ^([-a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/([0-9]+)/$ page.php?main=$1&sub=$2&next=$3&last=$4 [QSA,L]
Answer the question
In order to leave comments, you need to log in
Do you have to accept it as get variables? The easiest way to work with CNC is to create a function or class that will parse REQUEST_URI and return variables.
Something in the style:
function getUriParam($parameterNumber) {
$arrayParameters = explode('/', $_SERVER['REQUEST_URI']);
return $arrayParameters[$parameterNumber];
}
line www.site.com/media/1/2 regex^([-a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/$
does not match the regular expression, you require a slash at the end. request should be www.site.com/media/1/2/
RewriteRule ^([-a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/([0-9]+)/$page.php?main= $1⊂=$2&next=$3&last=$4 [QSA,L]
this problem is similar to the fact that there is a similar rule before the rule that includes the part of the request with the L flag,
I will clearly give an example:
RewriteRule ^(.*)/( .*)/(.*)/(.*)/$ /?do=open&s=$1&y=$2&x=$3&p=$4 [L] # this is the same rule you wrote
RewriteRule ^(.*)/( .*)/(.*)/$ /?do=open&s=$1&y=$2&p=$3 [L] # this is the rule that "works" before, it should be after
change places and see which ones in the CNC can be similar The URL
may be wrong in this situation without seeing the entire htaccess
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question