So essentially want I'm working on is Guild Hosting site but my htaccess isn't working anymore, here is what I want:
http://www.example.com/?page=test => http://www.example.com/test
http://www.example.com/?site=testsite => http://testsite.example.com or http://www.testsite.example.com
http://www.example.com/?site=testsite&page=test => http://testsite.example.com/test or http://www.testsite.example.com/test
I'm going to make it so PHP processes whether or not the site has a WWW. or not at the start of the web address using a boolean set in a MySQL Database but for now I just want to know how can setup my .htaccess
file to display all the sites like this and possibly redirect them to the right ones? Here is my current .htaccess
file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [OR]
RewriteCond %{HTTP_HOST} ^www\.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !index\.php
RewriteCond %{HTTP_HOST} ^(.+?)\.dev.randamonium.com$
RewriteRule ^([^/]+)/(.*)$ /index.php?site=%1&site=%2 [L]
<Files .htaccess>
order allow,deny
deny from all
</Files>
Options All -Indexes
I've tried looking for different things similar to this but I can't find ones specifically like mine so any ideas?