Je veux faire une URL de redirection
De
http://abc.redirect.in/admin/index.php?controller=class&action=add
À
http://abc.redirect.in/admin/class/add
Une idée?
Vous voulez supprimer du texte
http://abc.redirect.in/admin/
index.php?controller=
class&action=
add
Vous pouvez utiliser ce code dans votre fichier /admin/.htaccess
:
RewriteEngine On RewriteBase /admin/ RewriteCond %{THE_REQUEST} /admin/index\.php\?controller=([^\s&]+)&action=([^\s&]+) [NC] RewriteRule ^ %1/%2? [R=302,L,NE] # internal forward from pretty URL to actual one RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/.]+)/([^/.]+)/?$ index.php?controller=$1&action=$1 [L,QSA]
Regarde ça. .htaccess exemples magiques sur Github: https://github.com/phanan/htaccess