I am using this rule in the root htaccess
- Code: Select all
RewriteRule ^.([^/]*)-apartments\.html$ /ap/index.php?cityid=$1 [L]
to rewrite
http://www.apartmentoski.com/Riga-apartments.html
to
http://www.apartmentoski.com/ap/index.php?cityid=Riga
it works perfectly, as all the other rules work perfectly all over the site.
But...
I have another domain: http://www.myapartments.eu
it points to the same server and folder and as a consequence uses the same .htaccess.
(in case you wonder why I have 2 domains, this one shows different cities, but this does not matter here)
but, as you can see in
http://www.myapartments.eu/Riga-apartments.html
there is a problem with the city name which looses the first letter.
The variable
- Code: Select all
$cityname = $_GET['cityid'];
used in the page, which gets the city name from
http://www.myapartments.eu/ap/index.php?cityid=Riga
is actually getting it from
http://www.myapartments.eu/ap/index.php?cityid=iga
See Riga, becomes iga
(and so with all cities)
Now, changing the rewrite rule makes it work in myapartments.eu and generates an error in apartmentoski.com .
There seem to be no rule able to satisfy both domain names.
Also with other domains such as
http://www.mykrakowapartments.com/riga-apartments.html
it does not work.
the only difference is the domain name
Can anybody point me in the right direction?
I could use a php function to rewrite the wrong variable but it would not be elegant!
Thanks!
Luca