我正在做一个php项目。动态网址将被更改为搜索引擎友好的url。我正在创建htaccess文件来重写网址。我不熟悉.htaccess。 iam尝试在网址中插入bakslash。 如果URL不是以 “/” 或 “的.html” 然后在last.Please帮助添加一个反斜杠查询的网址与 “/” 或 “的.html”在网址的末尾插入斜杠htaccess
END END我现在想这个代码
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\..+$
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) http://www.example.com/$1/ [R=301,L]
这个代码只插黑斜杠为http://www.example.com/hh情况。但我会尝试在任何文档根
如添加反斜线
http://www.example.com/hh/yyy - http://www.example.com/hh/yyy/
http://www.example.com/h - http://www.example.com/h/
当你说[“反斜杠”(HTTP:// EN。 wikipedia.org/wiki/Backslash)你的意思是[正斜杠](http://en.wikipedia.org/wiki/Slash_%28punctuation%29),对吧? – MvG 2012-08-09 12:49:59