Etienne Dupuis Etienne Dupuis - 6 months ago 35
PHP Question

my .htaccess redirection fails

htaccess is enabled, i have the canonicalization running (no-www to www.)

I'm trying to use htaccess to do the following


I tried using this code snippet, with no luck so far:

rewriterule ^([a-zA-Z0-9_-]+)/$ page.php?i=$1

However I think I'm going the reverse way. I can't find example for this.
I have this but I can't make it work.


Try this:

RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/page\.php$
RewriteCond %{QUERY_STRING} ^i=([a-zA-Z0-9_-]+)$
RewriteRule ^(.*)$ [R=302,L]

taken from: