how to rewriterule for link like this
http://stanime.pe.hu/content.php?idf=15&link=Katsugeki--Touken+Ranbu
to http://stanime.pe.hu/15/Katsugeki--Touken+Ranbu
im encode and decode my url using Urlencode and urldecode
in database Collation im using latin1_swedish_ci
so, space
will replace with +
and /
replace with %2f
and more...
this my .htacces code
RewriteEngine On
# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} s/+content.php?link=([^s&]+) [NC]
RewriteRule ^ /%1? [R=302,L,NE]
# internal forward from pretty URL to actual one
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ content.php?link=$1 [B,L,QSA]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…