Etienne Dupuis Etienne Dupuis - 1 year ago 92
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.

Answer Source

Try this:

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

taken from:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download