0

我想为

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

我已经尝试过了,但离我需要的还很远,对吧?

# Enable Rewrite Engine
RewriteEngine on

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

1 回答 1

1

通过启用 mod_rewrite 和 .htaccess httpd.conf,然后将此代码放在您.htaccessDOCUMENT_ROOT目录下:

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

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=([^=]+)=([^&]+) [NC]
RewriteRule ^$ /%1/#!%1=%2? [L,R,NE]
于 2013-03-27T17:24:39.023 回答