just a quick one, I’m using this rule and it works fine:
RewriteRule ^([^/.]+)$ /profile.php?id=$1
so whatever come to mysite.com/anything will be read as mysite.com/profile.php?id=anything
That’s all good.
Then I need to add another variable so I used:
RewriteRule ^([^/.]+)/([^/.]+)$ /profile.php?id=$1&vid=$2
Which kind of works but it doesn’t load any css, js, external php…
I guess that’s why it’s looking in a different folder, I don’t know how to tell it get those other files from the root folder.
Any ideas?
That’s because you are creating virutal folders using the htaccess. If you want to load your CSS and JS properly, either use absolute paths or add ../ before your relative path (which means “one folder up”).
Another possibility is to add
<base href="www.example.com">. Which will cause all new requests (for images, external files, etc) to be relative to that path, and not the current address.