Monday, June 1, 2009

Rewriting Website in Apache

Here my website name is www.user.com and i am creating a rewrite rule like when i type www.user.com/ibn it will route to the site named www.ibnlive.com .

There are so many things one can do with rewrite rule is Apache this is only one example but usefull


ServerName www.user.com
#ServerAlias accent:80
DocumentRoot /var/www/www.user.com
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
RewriteCond %{REQUEST_HOST} !^www\.user\.com [NC]
RewriteCond %{REQUEST_URI} ^/ibn(.*) [NC]
RewriteRule ^/ibn(.*) http://www.ibnlive.com [NC,R=301]

No comments:

curl and cacert

curl -v --cacert cacert.pem https://www.example/cgi-bin/f ile.xgi -I -X POST