.htaccess rewrite subdomain

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

.htaccess rewrite subdomain

Post by potato »

Hi,

on my site, all the users have a profile page with http://www.mytuningcar.be/profile.php?id=username
what i want to do is, is giving all the users a url like watch.mytuningcar.be/username
i created the subdomain, no problem.

I tried many ways to rewite the url, but none worked.
First i edited the .htaccess code of the rootfolder
Afterwards i tried with the watch-folder.
My problem is that i dont know how to rewrite from the watch-folder to the root folder.

i hope you understand what i'm trying to explain.

many greetings,
tom
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

What have you tried untill now?
RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)$ /profile.php?id=$1 [L]
Post Reply