本文介绍了重写规则_escape_fragment_的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我想写一个重写规则 http://www.site.com/noticia/?_escaped_fragment_=noticia=/279/beto-cuevas3er-sencillo-dej-de-pensar到的http://www.site.com/noticia/#!noticia=/279/beto-cuevas3er-sencillo-dej-de-pensar我已经试过,但还远远没有我所需要的吧? #开启重写引擎RewriteEngine叙述上#Create友好的URL重写规则^的index.php?_escaped_fragment = =东西是$的index.php /#!东西= YES [L]解决方案 到的httpd.conf 启用了mod_rewrite和.htaccess,然后把这个code在的.htaccess $ DOCUMENT_ROOT 目录下: 选项+了FollowSymLinks -MultiViews#开启mod_rewrite的上RewriteEngine叙述上的RewriteBase /的RewriteCond%{QUERY_STRING} ^ _escaped_fragment _ =([^ =] +)=([^&安培;] +)[NC]重写规则^ $ /%1 /#!%1 =%2? [L,R,NE] i want to write a rewrite rule forhttp://www.site.com/noticia/?_escaped_fragment_=noticia=/279/beto-cuevas3er-sencillo-dej-de-pensarto:http://www.site.com/noticia/#!noticia=/279/beto-cuevas3er-sencillo-dej-de-pensari've tried this but is far from what i need right?# Enable Rewrite EngineRewriteEngine on#Create friendly URLRewriteRule ^index.php?_escaped_fragment=something=yes$index.php/#!something=yes [L] 解决方案 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 onRewriteEngine OnRewriteBase /RewriteCond %{QUERY_STRING} ^_escaped_fragment_=([^=]+)=([^&]+) [NC]RewriteRule ^$ /%1/#!%1=%2? [L,R,NE] 这篇关于重写规则_escape_fragment_的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-15 07:50