how to remove %20,:,/,? and many more from url with .htaccess? im already try code from this post, but still not replace/redirect to new url .htaccess url rewrite and removing %20.
this my .htaccess code
RewriteEngine On RewriteBase / # external redirect from actual URL to pretty one (remove query string) RewriteCond %{THE_REQUEST} \s/+content\.php\?judul=([^\s&]+) [NC] RewriteRule ^ %1? [R=302,L,NE] # convert all space (%20) to hyphen RewriteRule "^(\S*) +(\S* .*)$" $1-$2 [N,NE] RewriteRule "^(\S*) (\S*)$" $1-$2 [L,R=302,NE] # rewrite rule to call actual PHP handler RewriteRule ^([^./]+)\.html$ content.php?judul=$1 [L,QSA,NC] my link
http://localhost/web/content.php?judul=Fate/Apocrypha
http://localhost/web/content.php?judul=Isekai%20wa%20Smartphone%20to%20Tomo%20ni
i want "%20" and "/" replace with "-" like this one.
http://localhost/web/content.php?judul=Fate-Apocrypha/
http://localhost/web/content.php?judul=Isekai-wa-Smartphone-to-Tomo-ni/
%20is a url encoded space character, don't put spaces in URL notations and they won't encode that way.<a href="content.php?judul=<?php echo $value['judul']; ?></a>