Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Is it possible to rewrite a subdomain to a variable?
Old 03-12-2012, 01:54 PM Is it possible to rewrite a subdomain to a variable?
Super Talker

Posts: 116
Trades: 0
Say I have a URL like this:

Code:
www.foo.website.com/some-page
Is it possible to rewrite the URL to this?

Code:
www.website.com/some-page?var=foo
I'm asking about a rewrite and not a redirect, so I'm wanting the first URL to stay in the address bar, but for the server to "get" the second URL. Also, as you can probably deduce, this needs to work for any subdomain, not just "foo."

I should add that this .htaccess file is also being used by WordPress and has the following code:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~kbj/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~kbj/index.php [L]
</IfModule>
Is what I'm asking possible to do?
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-12-2012, 05:04 PM Re: Is it possible to rewrite a subdomain to a variable?
chrishirst's Avatar
Defies a Status

Posts: 43,972
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
If it is WP3 it has multi-site capabilities built in.

http://codex.wordpress.org/Create_A_Network
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-15-2012, 09:15 PM Re: Is it possible to rewrite a subdomain to a variable?
Super Talker

Posts: 116
Trades: 0
I'm not trying to make multiple WordPress sites, though.

Is what I asked possible? If so, does anyone know how to write the .htaccess code?
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
Old 03-16-2012, 07:12 AM Re: Is it possible to rewrite a subdomain to a variable?
chrishirst's Avatar
Defies a Status

Posts: 43,972
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by Learnin' n00b View Post
I'm not trying to make multiple WordPress sites, though.
But that is EXACTLY what you ARE doing.

You want a sub-domain, which to all intents and purposes is an independent website, to resolve so a particular document located at a particular URI, or do you honestly think that every subdomain at wordpress.com is a seperate installation of Wordpress?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Is it possible to rewrite a subdomain to a variable?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15055 seconds with 11 queries