I wonder, how does tumblr doing profile url like this:
http://www.username.tumblr.com/
http://username.tumblr.com/
I know we can change the profile url
http://www.website.com/profile.php?user=username
to
http://www.website.com/username
using the following RewriteRule
RewriteRule ^([^/]+)/?$ profile.php?user=$1 [L,QSA,NC]
I don't know how tumblr doing those profile urls.
How can we make user profile urls like this:
http://www.username.website.com/
http://username.website.com/
I have a VirtualHost.
From the Instagram home screen, tap your profile icon, followed by the menu icon in the top right. Select Settings > Account > Sharing to other apps. Select the account you want to link and enter your login information. You can link a number of networks, including Facebook, Twitter, and Tumblr.
Key solution: wildcard subdomains.
This allows you to make *.domain.com
point to your server.
From your example, let's say we enabled wildcard subdomains for domain.com
and we want to provide user subdomains, such as http://username.domain.com
. You'd have something like this:
RewriteCond %{HTTP_HOST} ^((?!www.)[^.]+)\.domain\.com$ [NC]
RewriteRule ^(.*)$ /%1/$1 [L]
where http://username.domain.com/xxx
would point to /username/xxx
.
Note that this example has been reduced and simplified as much as possible for the explanation. You'd maybe need other rules, depending on your context, to handle main domain and other conditions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With