I need an HTACCESS, MOD REWRITE code that will create dynamic sub-domains.
The URL will need to be like this:
will contain the content fromCode:
Payment via paypal.Code:
I need an HTACCESS, MOD REWRITE code that will create dynamic sub-domains.
The URL will need to be like this:
will contain the content fromCode:
Payment via paypal.Code:
whats ur host like vps, dedicated, shared, master reseller etc
i have hostgator shared a/c with wildcard dns enabled
There is my own SUBDOMAIN REGISTRATION SCRIPT. Without htaccess But work fine.
Maybe you can do something self ;)
STOP SAYING LOL
Code:RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP_HOST} ^([^.]+).mydomain.com$ [NC] RewriteRule ^([A-Za-z]+)(/)?$ index.php?customer=$1
Super Cheap hosting:
Read Tearms&Conditions here:
FAQ:
Support forum:
WapMasterz.Net is back with new forum style!!
Click this image to goto wapmasterz site!
thanks subzero i tried ur code but not working. redirecting to index page.
i trid this codes too but not working.
Code:<IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ([^\.]+).site.(.*) RewriteCond %{HTTP_HOST} !^wap.site.(.*) RewriteCond %{HTTP_HOST} !^www.site.(.*) RewriteRule ^(.*)$ index.php?id=%1 [L,NC] </IfModule>Code:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*)\.site\.com [NC] RewriteCond %1 !^(www|wap)$ [NC] RewriteRule ^$ index.php?id=%1 [L] </IfModule>
Last edited by krazyguy; 13-01-10 at 12:10.
i am not sure does your server host provide you correct wildcard dns setting for your domain (ask them for that you need to correct and proper wild card dns setting which need to update httpd.conf and add litle bit things in whm ) if they provide wild card dns setting you do not need to use htaccess just use this method in index.php
help here
can you able to open your main page or apache success ?
there are also thing you need to check every http request which will check user from mysql if user is valid and it it will send as you want or where you want else could send at main page or 404 not found as you wishPHP Code:$serverhost = explode('.',$_SERVER["HTTP_HOST"]);
$sub = $serverhost[0];
if ($sub = "www") {
$sub = "";
}
Last edited by GiLL; 13-01-10 at 13:18.
Build Own site Free
Add your site here
Free downloads
there is an error in php code above, it should be:Originally Posted by GiLL
PHP Code:$serverhost = explode('.',$_SERVER["HTTP_HOST"]);
$sub = $serverhost[0];
if ($sub == "www") {
$sub = "";
}
coding-talk.com - a place where noobs become professionals
Advertise your mobile site for FREE with
Sub, that code, like mine :D
$host = strtolower($_SERVER["HTTP_HOST"]);
$sk = explode(".", $host);
if(count($sk) == 3 && $sk[0]!="www")
{
}
STOP SAYING LOL
yours in php bro mine is .htaccess
Super Cheap hosting:
Read Tearms&Conditions here:
FAQ:
Support forum:
WapMasterz.Net is back with new forum style!!
Click this image to goto wapmasterz site!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks