?
Solved

Re-write question - faking subdomains

Posted on 2007-04-01
6
Medium Priority
?
206 Views
Last Modified: 2010-03-04
I would like 'fake' a subdomain.

If the user enters:  someUsername.mysite.com

I would like the actual page to be:

mysite.com/?someUsername

Also have more questions, but will save them for once this gets working.

Thanks

0
Comment
Question by:edvinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:JamesCssl
ID: 18832367
You may try something like this:

RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^.*$ /%1

replace example.com with your domain
0
 
LVL 1

Author Comment

by:edvinson
ID: 18848084
Where do I put that?

In my config file?
0
 
LVL 11

Expert Comment

by:JamesCssl
ID: 18848112
Yes; you could either put it in your httpd.conf if you have access to it, or in your .htaccess file.  You may have to add the following line before the code I provided above:
RewriteEngine On

so:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^.*$ /\?%1
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:edvinson
ID: 18848145
JamesCssl:

I tried this, and it did not work. I think it's because I am already using a subdomain:

dev.mysite.com

so, I suppose I can't use :  username.dev.mysite.com ?

0
 
LVL 11

Accepted Solution

by:
JamesCssl earned 2000 total points
ID: 18873922
So, changing it to:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.dev\.example\.com$ [NC]
RewriteRule ^.*$ /\?%1

doesn't work?
0
 
LVL 1

Author Comment

by:edvinson
ID: 18902334
Havent tried, been busy. But I am sure it will!

Thanks.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question