views:

29

answers:

1

hi how can i get full url with & sign

RewriteRule category/(.*)$ categories.php?url=$1 [PT,L]

my url is category/pets-&-wets/ but when i get

echo $_GET['url']; it shows only pets-

any suggestions thanks

+4  A: 

That's happening because the & marks the start of another GET argument - since the rewritten URL would end up looking like categories.php?url=pets-&-wet.

You need to encode your & as %26, so your URL is category/pets-%26-wet.

Better still, whatever is generating your slugs replaces ampersands by and, so your URL would be category/pets-and-wet.

Dominic Rodger