here is my sample url:
http://mydomain.com/开发者_开发知识库folder/subfolder/index.php?site=www.othersite.com
i want to rewrite it this way:
http://mydomain.com/folder/subfolder/www.othersite.com
i tried
RewriteEngine on
RewriteBase /folder/subfolder/
RewriteRule ^([A-Za-z0-9\\-\\.]+)$ index.php?site=$1 [L]
i printed the array $_GET and returns the value of the 'site' parameter as 'index.php', it didn't return 'www.othersite.com'
how can this be done?
thanks,
Try this rule in your .htaccess file:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{QUERY_STRING} !^site= [NC]
RewriteRule ^(folder/subfolder)/(.*)$ /$1/index.php?site=$2 [L,NC,QSA]
精彩评论