Is it possible to use rewrite rules depending on a php variable? for example, i got 10 websites with 10 domains. each website got a "config.php". Inside this file, there is a variable called $city.
can i rewrite the url in this style?
pseudocode:
if ($city == 'berlin') {
page.php = page-berlin.php
}
You could write a simple routing script that all of your domains are pointed to. Using $_SERVER['server_name'] you then loading the required config file, which has the file it needs to include to give you the required output, or it loads in the config.php file, which sets a constant using define('CITY', 'BERLIN') which the rest of your script can use.
This isn't rewriting, but it should work for your situation.
Have a look at this answer in which changes the url of the browser without refreshing the page, it can solve your problem if it is just the look of the url you want.