Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subdomain faking with mod_rewrite?

Status
Not open for further replies.

AJRAD

Programmer
Jan 17, 2008
3
GB
Hi,
Can somebody help me with this please:
I'm creating a site where users register and get a subdomain.. but I don't want the subdomains to physically exist - I want to use htaccess to... ahhh I'll demonstrate:

I want to go to ==> etc etc

I do *NOT* want the page to redirect.. I want user.domain.com/anything to display in the address bar but use the other file.

Thanks in advance.
-Alex
 
If you are not going to use sub-domains then this is not an apache issue.
 
I am using mod_rewrite - it is an apache issue.
How do I do what I said?
 
No.. nothing on that page works.
What is mod_proxy and how do I enable it?

By the way.. my host has enabled wildcard subdomains and everything should work but something is wrong.
 
You need to install mod_proxy, either built in or dso. and mod_rewrite of course:

LoadModule proxy_module libexec/libproxy.so
...
AddModule mod_proxy.c

Also enable the rewrite logs and level to see what is happening:
RewriteLogLevel 2
RewriteLog /usr/local/apache/logs/rewrite_log


I was testing on a local box, where
this was the default VirtualHost:

<VirtualHost *:8080>
ServerName 127.0.0.1
DocumentRoot /usr/local/apache/htdocs
RewriteEngine on
RewriteCond %{HTTP_HOST} ([^.+])\.domain\.com [NC]
RewriteRule ^(.*) [P]
</VirtualHost>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top