rewritecond
rewritecond
Redirecting From One Domain To Another Using Mod Rewrite
Fri, 01/06/2012 - 17:44 | by philipnorton42Use the following rules in your Apache configuration (or your .htaccess file) to redirect all traffic from one domain to another. This also keeps the query string in place so that the user isn't just dumped to the homepage.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com%{REQUEST_URI} [L,R=301]
These rules are mod_rewrite dependent, so you'll need that module enabled in your Apache install.
Using mod_rewrite On Form Parameters
Wed, 03/05/2008 - 12:42 | by philipnorton42Using mod_rewrite on websites is fairly straightforward and can create some lovely looking URL structures. Instead of having a URL that contains lots of odd looking parameters like this:
http://www.example.com/example.php?parameter1=value1¶meter2=value2
You can use a .htaccess file to rewrite the URL on the server side in order to shorten this to something like this: