Apache Server configuration support - subdomain to domain rewrite help in htaccess

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > April 2007 > subdomain to domain rewrite help in htaccess





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author subdomain to domain rewrite help in htaccess
Bhasker V Kode

2007-04-23, 7:26 pm

hi,
i have enabled mod_proxy , mo_proxy_http and mod_rewrite . My
requirements are simple , but im not sure whether to use proxy*
directives in my htaccess or rewriterule 's .

i want to redirect http://subdomain.b.org/ to http://b.org/handle.php
in other words http://subdomain.b.org/foo.txt to
http://b.org/handle.php?var1=foo&var2=txt

this is what im using now . with some help from the apache irc channel
i was suggested to correct the flag from R=301 to PT. here is how it
stands now .

RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain.b.org$ [NC]
RewriteRule ^([a-z]+).([a-z]+)$ http://b.org/handle.php?var1=$1&var2=$2[PT]

what do i need to use ? currently what is happening is that suppose i
give a request on my browser for :

http://subdomain.b.org/foo.txt
i intend the url to remain the same(hence the PT) ,but the page to be
loaded from :
http://b.org/handle.php?var1=foo&var2=txt

the error log shows nothing ,while access log gives a :
127.0.0.1 - - [24/Apr/2007:02:11:39 +0530] "GET /foo.txt HTTP/1.1" 400
444

Thanks for your time .

Keep Clicking,
Bhasker

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com