Revision [3750]

Last edited on 2010-07-13 00:58:02 by KenFong
Additions:
With or without www.
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]


Revision [2244]

Edited on 2009-03-20 17:05:31 by WikiAdmin
Additions:
Rewrite should not be encouraged. Most of the time this can be handled by the application - where they have the luxury to compile and debug their work. Use rewrite to redirect to a different port or a maintenance page is fine. Using it to fix mindless applications is sickening.
Deletions:
Just check out the examples


Revision [2243]

Edited on 2009-03-20 17:01:47 by WikiAdmin
Additions:
%%(apache;host header)
RewriteCond %{HTTP_HOST} ^[^.]+\.some\.corp$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.some\.corp/?(.*) http://www.some.corp/bla/$1/$2 [R,L]


Revision [1926]

Edited on 2008-09-05 09:53:33 by WikiAdmin
Additions:
Multiple match in request_uri
RewriteCond %{REQUEST_URI} ^/educators/blog
RewriteCond %{REQUEST_URI} !^/educators/blog/index.php
RewriteCond %{QUERY_STRING} ^(cat=|tag=|p=)
RewriteRule .* /educators/blog/index.php [R=301,L]


Revision [1355]

Edited on 2008-01-23 19:50:57 by WikiAdmin
Additions:
RewriteCond %{REQUEST_URI} ^/list.php
RewriteRule .* http://www.xxx.com/cat/whatever.html [R=301,L]
RewriteRule .* http://www.xxx.com/cat/whatever.html%1 [R=301,L]
Note: depending on where you put these rewrite directives, the condition may be slight different. If you are putting them in httpd.conf, the prevailing slash is necessary
RewriteCond %{REQUEST_URI} ^/list.php
If you are putting them into .htaccess, the prevailing slash must be ignored.
RewriteCond %{REQUEST_URI} ^list.php
Deletions:
RewriteRule .* http://www.xxx.com/cat/Under-Armour-Mens-100593-pg1.html [R=301,L]
RewriteRule .* http://www.xxx.com/cat/Under-Armour-Mens-100593-pg1.html%1 [R=301,L]


Revision [1125]

Edited on 2007-11-05 22:08:02 by WikiAdmin
Additions:
%%(apache; query_string)


Revision [1124]

Edited on 2007-11-05 22:07:42 by WikiAdmin
Additions:
This is a stupid one requested by the client. But the QUERY_STRING part is good.
RewriteOptions MaxRedirects=10
RewriteLogLevel 2
RewriteLog /home/sites/logs/rewrite.log
RewriteCond %{QUERY_STRING} ^cat=100011$
RewriteRule .* http://www.xxx.com/cat/Under-Armour-Mens-100593-pg1.html [R=301,L]
RewriteCond %{QUERY_STRING} ^cat=100011(.+)$
RewriteRule .* http://www.xxx.com/cat/Under-Armour-Mens-100593-pg1.html%1 [R=301,L]


Revision [1118]

The oldest known version of this page was created on 2007-11-01 18:51:52 by WikiAdmin
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki