PHP Classes

.htaccess question

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  .htaccess question  
Subject:.htaccess question
Summary:Dynamic subdomain and URI
Messages:2
Author:Miguel Guerreiro
Date:2011-01-18 15:39:05
Update:2011-01-23 07:19:28
 

  1. .htaccess question   Reply   Report abuse  
Picture of Miguel Guerreiro Miguel Guerreiro - 2011-01-18 17:04:44
I want to do the following:

If I go to subdomain.site.com, it is now going to page.php?str=subdomain.

What I need to do is, if I go to subdomain.site.com/thisfile, I need to go to page.php?str=subdomain&u=thisfile.

Here is what I have so far.

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ([^\.]+)\.site\.com [NC]
RewriteCond %1 !^(www|ftp|mail|test|dev) [NC]
RewriteRule ^(.*)$ page.php?str=%1 [L]

Any help would be greatly appreciated.

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.