In .htaccess how to get a particular value

£可爱£侵袭症+ 提交于 2020-01-25 18:04:49

问题


I am trying to get a specific value from url

like my url is

http://www.example.biz/?_escaped_fragment=reader/i/1664

and I want to get output url is like below

http://www.example.biz/seo/1664

I have tried this

RewriteCond^(.*?)_escaped_fragment_=(.*)$ 
RewriteRule ^(.*)$ seo/%1 [NC]

But Output url is coming below

http://www.example.biz/seo/%1?_escaped_fragment=reader/i/1664

How will I do this? Any help appreciated.


回答1:


You're not trying to match anything in your RewriteCond.

RewriteCond %{QUERY_STRING} (?:^|&)_escaped_fragment=reader/i/(\d+)$
RewriteRule ^(.*)$ seo/%1 [L]


来源:https://stackoverflow.com/questions/24993746/in-htaccess-how-to-get-a-particular-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!