Matt Fiddles

Life's so vast, there's just so much to do...

User Tools

Site Tools


"`In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Aplha Centauri.'"

- The Book getting all nostalgic.

Where will you go today?

"Concentrate...feel the Force flow. Yes. Good. Calm, yes. Through the Force, things you will see. Other places. The future...the past. Old friends long gone."

- Yoda

Apache mod_rewrite Tips

Some other tips are here

Query Strings

Rewrite Query Strings

Capture Query Strings

Apache .htaccess query string redirects

Note: $1 is for paths, %1 is for query strings (mostly)

Remove Query

RewriteCond %{REQUEST_URI} /page [NC]
RewriteRule ^(.*)$ /%1? [R=301,L]


RewriteCond %{QUERY_STRING} id=(.*) [NC]
RewriteRule ^(.*)$ /$1/%1 [R=301,L]


Replace Characters

Replace : with /.

RewriteRule ^(.*):(.*)$ $1/$2 [R=301,L]
computers/websites/apache-mod_rewrite.txt · Last modified: May 28, 2014 (4 years ago) by Matt Bagley