Hello, This is my first post to this forum, so I will try my best to be as descriptive as possible. What I'm trying to do is use wildcard subdomains for all users registered with the website; EG: jijarine.domain.com. That part was easily done. However, now with have the user with there subdomain, and allowing that subdomain to refrence further things such as: jijarine.domain.com/profile/ would be in reality refrence: /profiles/index.php?who=%1 (where %1 would be the subdomain name/username). The problem I'm having is, that the below rule regarding profiles is not working: If I remove the line regarding profiles, everything works accordingly, I've tried many variations to that line with no avail. I've also scowered the net for hours looking for information regarding too this subject with no avail. Any assistance would be greatly appreciated.
is not matter of mod_rewrite, if you server has not wildcard support enable you will not be able to do anything. how to verify if your browser is wildcarded capable? type http:// whatever. yourdomain.com if you site your main index page then the problem is you above directives, but if you got nothing, you need to move your site to another server or ask the admin to enable that function. Based on my own experience, most server has not wildcard support or it's disable. The only I have seen with such capability is www.servage.net check the site of a friend of mine hosted there: http://www.faqdirect.com type whatever instead of www and you will get the index page... that is a wildcard enable server. if you do the same at my site http://www.zota.info ( i.e. http://mystique.zota.info or whatever) you will get nothing because my server has not that support.
wildcard subdomains are enabled. I'm capable of going to any x.domain.com subdomain through my server. Everything conserning wildcard subdomains are enabled. My problem is being capable of refrencing (mod_rewrite) another file with an argument following the address. EG: Which does not work. My question is, what works? How do I accomplish this?
kinda friendly URLs? RewriteEngine On RewriteRule ^profiles/(.*)/(.*).php/index.php?who=jijarine Code (markup): not sure it works though however maybe this thread give you an idea: http://www.sitepoint.com/forums/showthread.php?t=110101 or any trick of these: http://corz.org/serv/tricks/htaccess2.php?page=all
I guess the simplist way of exsplaining this would be to user live journal as an example. I'm trying to accomplish exactly what they do with there users and those users journals using subdomains etc. URL: http://jijarine.domain.com/ POINTS TO: http://www.domain.com/journals/index.php?who=subdomain http://jijarine.domain.com/profile/ POINTS TO: http://www.domain.com/profiles/index.php?who=subdomain http://jijarine.domain.com/10/2006/ POINTS TO: http://www.domain.com/journals/index.php?who=subdomain&month=10&year=2006 http://jijarine.domain.com/04/10/2006 POINTS TO: http://www.domain.com/journals/index.php?who=subdomain&day=04&month=10&year=2006 I had this previously setup and working correctly using rewrite rules without subdomains. Just simply www.domain.com/jijarine/04/10/2006/ etc pointing to the proper place. But now redardless of what I do: RewriteCond %{http_host} !^www.domain.com$ RewriteCond %{http_host} ^([^.]+)\.domain\.com$ RewriteRule ^profile/$ /profiles/index.php?who=%1 [QSA] RewriteRule ^(.*)$ /journals/index.php?who=%1 [QSA] Code (markup): everything allways goes to /journals/index.php?who=%1, regardless if there is a subfoolder. EG: jijarine.domain.com/profile/ Its very frustrating.
Solved! With the aid of this thread: http://www.sitepoint.com/forums/showthread.php?postid=1023667#poststop In conclusion: Options +FollowSymLinks RewriteEngine on # Profiles RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com [NC] RewriteRule ^/profile/$ /profiles/index.php?who=%2 [L] # Journals RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC] RewriteRule ^(.*)$ /journals/$1 Code (markup):