.htaccess

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pedroz
Forum Commoner
Posts: 99
Joined: Thu Nov 03, 2005 6:21 am

.htaccess

Post by pedroz »

I would like to have the following:

http://london.domain.com/
http://newyork.domain.com/bronkx/
redirecting to
index.php?subdomain=%1&neighborhood=%2

RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/([^/]+)?$ [NC]
RewriteRule ^/(.*)/?$ /index.php?subdomain=%1&neighborhood=%2 [L]

what is wrong here?

thanks
Post Reply