rewrite rule for _escape_fragment_ [closed]

ぃ、小莉子 提交于 2019-12-13 04:15:35

问题


i want to write a rewrite rule for

http://www.site.com/noticia/?_escaped_fragment_=noticia=/279/beto-cuevas3er-sencillo-dej-de-pensar

to:

http://www.site.com/noticia/#!noticia=/279/beto-cuevas3er-sencillo-dej-de-pensar

i've tried this but is far from what i need right?

# Enable Rewrite Engine
RewriteEngine on

#Create friendly URL
RewriteRule ^index.php?_escaped_fragment=something=yes$ 
index.php/#!something=yes [L]

回答1:


Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=([^=]+)=([^&]+) [NC]
RewriteRule ^$ /%1/#!%1=%2? [L,R,NE]


来源:https://stackoverflow.com/questions/15664861/rewrite-rule-for-escape-fragment

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