strona.pl/asdf/asdf
kierowała na strona.pl/index.php?adres=asdf/asdf
tralala.strona.pl/asdf/asdf
kierowała na strona.pl/index.php?adres=asdf/asdf&subdomena=tralala
tralala.strona.pl na strona.pl/index.php?subdomena=tralala
jak dotąd udało mi się zrobić pierwszy element :
.htaccess
Kod
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?adres=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?adres=$1 [L,QSA]
vhost
Kod
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "c:/strona/public"
ServerName strona.localhost
ErrorLog "logs/strona.localhost.log"
CustomLog "strona.localhost.log" common
<directory "c:/strona/public">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
</VirtualHost>
ServerAdmin webmaster@localhost
DocumentRoot "c:/strona/public"
ServerName strona.localhost
ErrorLog "logs/strona.localhost.log"
CustomLog "strona.localhost.log" common
<directory "c:/strona/public">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
</VirtualHost>
serwer to świeżo zainstalowany wamp (z włączonym rewritem i vhost)