php - %26 in query string is breaking the $_GET part -


for page

www.industrialstores.com/search_results/bell+%26+gossett+101238+1.25"+sweat+checktrolflangeset/46 

i not getting value in $_get['s']

the value in $_get['s'] should bell gossett 101238 1.25" sweat checktrolflangeset bell passed $_get['s']

i tried urldecode(), htmlentities not of use.

my .httaccess file like

rewriterule ^([a-za-z0-9_-]{3,100})/([^/]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3 [l] rewriterule ^([a-za-z0-9_-]{3,100})/([^/]+)/([a-za-z0-9_]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3&p=$4 [l] rewriterule ^([a-za-z0-9_-]{3,100})/([^/]+)/([a-za-z0-9_]+)/([a-za-z0-9_]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3&p=$4&q=$5 [l] rewriterule ^([a-za-z0-9_-]{3,100})/([^/]+)/([a-za-z0-9_]+)/([a-za-z0-9_]+)/([a-za-z0-9]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3&p=$4&q=$5&r=$6 [l] 

as second rikudo wrote, rewrite rules not accepting & character (%26).

try this;

rewriterule ^([a-za-z0-9_-\&]{3,100})/([^/]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3 [l] rewriterule ^([a-za-z0-9_-\&]{3,100})/([^/]+)/([a-za-z0-9_\&]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3&p=$4 [l] rewriterule ^([a-za-z0-9_-\&]{3,100})/([^/]+)/([a-za-z0-9_\&]+)/([a-za-z0-9_\&]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3&p=$4&q=$5 [l] rewriterule ^([a-za-z0-9_-\&]{3,100})/([^/]+)/([a-za-z0-9_\&]+)/([a-za-z0-9_\&]+)/([a-za-z0-9\&]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3&p=$4&q=$5&r=$6 [l] 

also, these rewriterules not efficient. go this;

rewriterule ^(.*)$ index.php?route=$1 [l] 

and matching in php. there lot of frameworks have excellent routing built in, can use or build own, using explode() function in php.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -