0

i have a problem with urlencode and links. When i have a link that has "/" inside the name of the product let's says my url breaks. I use urlencode and i also have a mod_rewrite for links. Let's say that for nume $produs['Nume_Prod'] i have a slash inside name my url breaks. For example this link does not work http://onyboutique.ro/Rucsacuri/Rucsac%2fghiozdan%20dama%20negru%20cu%20alb%20Scotti/ . At decode it displays just ghiozdan dama negru cu alb Scotti instead Rucsac/ghiozdan dama negru cu alb Scotti

<a href="/'.urlencode($produs['Nume_Categ']).'/', urlencode($produs['Nume_Prod']), '/" data-id="'.$produs['ID_Produs'].'">Products</a>


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^-]*)/([^-]*)/$ /detalii_produs.php?cat=$1&nume=$2 [L,B] 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1 [R=301,L] 
chris227
  • 579
  • 9
  • 28
  • Urls with `%2f` or `%5c` return a `404` from Apache for security purposes and your `.htaccess` won't be invoked. – anubhava Aug 09 '16 at 14:43
  • it does not return 404, it does not decode as it should `Rucsac/ghiozdan dama negru cu alb Scotti` – chris227 Aug 09 '16 at 14:47
  • Possible duplicate of [urlencoded Forward slash is breaking URL](http://stackoverflow.com/questions/3235219/urlencoded-forward-slash-is-breaking-url) – BadHorsie Aug 09 '16 at 14:48

0 Answers0