is this redirection possible in post method of form submit

Using a single web hosting account to host multiple sites

is this redirection possible in post method of form submit

Postby webbee » Sat Sep 30, 2006 10:49 am

Hi,
I need somehing like this for POST method of html form submit:

http://www.subd.domain.com/cgi-bin/abc.pl?abc=xyz -> http://domain.com/cgi-bin/file.pl&subdo ... pl?abc=xyz

I mean all the subdomains and folders will be forwarded to a file stored at a place .It shuld also have the query string of the original URL.

Also this need to work in the POST submit where the user will submit to the subdomain.

Expecting your replies.
--
Regards,
Abhishek jain
webbee
 
Posts: 3
Joined: Sat Sep 30, 2006 10:43 am

Postby richardk » Sat Sep 30, 2006 2:23 pm

Do you have DNS for the subdomain(s)?
The subdomains need to point to your main document root.

Then you could do this:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)domain\.com$ [NC]
RewriteRule !^cgi-bin(/.*)?$ /cgi-bin/file.pl?subdomain=%1%2&rest=%{REQUEST_URI}?%{QUERY_STRING} [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby webbee » Sat Sep 30, 2006 10:57 pm

hi,
Thanks for the quick response ,
Yes the DNS for the subdomains is in place.

I tried the rules but these was nt working i read some tutorials and found:

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{SCRIPT_URL} !^cgi-bin
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
RewriteRule (.*)$ http://domain.com/cgi-bin/file.pl?subdomain=%1%2&rest=%{REQUEST_URI}&%{QUERY_STRING} [R,L]

Now i want to make them silent ie no user can see wats behind the original URL.
Pl. comment on the rules and how to make them silent. I tried o mozilla and it showed there.
And i hope this will work on POST requests also.
Thanks,
--
Abhishek jain
webbee
 
Posts: 3
Joined: Sat Sep 30, 2006 10:43 am

Postby richardk » Sun Oct 01, 2006 8:22 am

Try:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/cgi-bin(/.*)?$
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
RewriteRule ^(.*)$ /cgi-bin/file.pl?subdomain=%1%2&rest=%{REQUEST_URI}&%{QUERY_STRING} [L]


If it doesn't work, it's probably bacause it's the cgi-bin.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 71 guests

cron