Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a system which users can skin/style according to their preferences.

I also want to enable users to use their custom-URL and am struggling to set this up correclty.

I have set up the user settings to include a custom-url and ask the user to create an A record in his DNS configuration pointing requests from his custom-url to his application-url on my platform.

So the user picks and points

 http://app.usersPage.com 

to his platform app-url (using SSL):

 https://www.myPage.com?user=112345

I'm not sure how I need to continue.

Do I need to

a) Create an entry like this in my vhost.config or httpd.config file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?app.usersPage.com$ [NC]
RewriteRule ^/$ https://www.myPage.com?user=112345 [L,P]

and add a rewriteCond plus graceful restart the server every time a user adds a new custom-URL?

b) Do I need to create vhosts for every user-url by adding something like this to the vhost.config

NameVirtualHost *:80

# default
<VirtualHost *:80>
  ServerName www.myPage.com
  ServerAlias myPage.com *.myPage.com
  DocumentRoot /www/htdocs
</VirtualHost>

#entries for custom-url
<VirtualHost *:80>
  ServerName app.usersPage.com
  DocumentRoot /www/htdocs
</VirtualHost>

I'm leaning to the first solution, but ... I'm not really sure what I'm doing.

A lot of questions:
a) is a) the correct approach in this scenario?
b) will this display my application url or the users custom url?
c) what if the user navigates through the page. All my links are relative, but will the custom url persist?
d) what about switching to SSL from non-SSL custom-url requests?

THANKS for shedding some light.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.