Вот мой пример URL:
http://mydomain.com/folder/subfolder/index.php?site=www.othersite.com
Я хочу переписать это так:
http://mydomain.com/folder/subfolder/www.othersite.com
я пытался
RewriteEngine on RewriteBase /folder/subfolder/ RewriteRule ^([A-Za-z0-9\\-\\.]+)$ index.php?site=$1 [L]
Я распечатал массив $ _GET и вернул значение параметра 'site' в виде 'index.php', он не вернул 'www.othersite.com'
howэто можно сделать?
спасибо,
Попробуйте это правило в своем файле .htaccess:
Options +FollowSymlinks -MultiViews RewriteEngine on RewriteCond %{QUERY_STRING} !^site= [NC] RewriteRule ^(folder/subfolder)/(.*)$ /$1/index.php?site=$2 [L,NC,QSA]