Re: URL re-writing problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks guys for your suggestions. In mean time i have got a good link describing many situations.

These situations I believe has many takers.

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html


Regards,
Vijay Shanker Dubey



On Wed, Dec 23, 2009 at 6:46 AM, Igor Cicimov <icicimov@xxxxxxxxx> wrote:
Only this %(HTTP_HOST) should be in curly brackets


On Wed, Dec 23, 2009 at 1:51 AM, Oliver Schoenborn <schoenb@xxxxxxx> wrote:
Vijay,
If you have a small number of subdomains, I would try, for each one:

<virtualhost *:80>
   ServerName subdomainN.domain.com
   ProxyRequests off
   ProxyPass         /   http://domain.com/key/subdomainN
   ProxyPassReverse  /   http://domain.com/key/subdomainN
</virtualhost>

Otherwise I would try a rewrite rule such as:

RewriteCond %(HTTP_HOST) (.+).domain.com
RewriteRule ^(.+)$ %(HTTP_HOST)$1    [C]
RewriteRule (.+).domain.com(.*) http://domain.com/key/$1$2     [L]

The first rule is required so that pattern matching can extract the subdomain name. The condition can be removed if the rewrite rules appear in a vhost.

Oliver


From: vijay shanker [mailto:vijay.shad@xxxxxxxxx]
Sent: December 22, 2009 4:49 AM
To: users@xxxxxxxxxxxxxxxx
Subject: URL re-writing problem

Hi all,

I am very new to httpd server. And i have a immediate problem to solve. My server instance is running on centos box.

If a request comes to my server as

----
http://sub-domain.domain.com
---

This should be translated to 

---
http://domain.com/key/sub-domain
---

I have configured many virtual host on my server. But this is quite a case and i am running out of ideas 


Any suggestion: what should i do?




Regards,
Vijay Shanker Dubey

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux