I would like to create virtual sub domains for clients who will have websites with us but the websites will be served from a single url in reality for example;
main site:
domain.com/post/20/Posttitle
domain.com/index.php?r=post/20/Posttitle
sub site:
mysub.domain.com
domain.com/index.php?s=mysub
OR
mysub.domain.com/post/20/Posttitle
domain.com/index.php?s=mysub&r=post/20/Posttitle
OR
mysub.domain.com/Cat/2/cattitle
domain.com/index.php?s=mysub&r=Cat/2/cattitle
OR
mysub.domain.com/{OrderURL}
domain.com/index.php?s=mysub&r={OrderURL}
....
** In a general example: Blog system
How do i do this?
Also my setup is with PHP{Something like the MVC} and cPanel / WHM server.
Note: The design on localhost
Here is the htaccess code i have tried so far (does not work properly);
RewriteCond %{HTTP_HOST} ^(http://|https://)?(www\.)?(.*\.)?(.*)$
RewriteRule (http://|https://)?(www\.)?(.*\.)?(.*)$ index.php?s=$3&r=$4 [L,NC,QSA]
RewriteRule ^(.*)$ index.php?r=$1 [L,NC,QSA]