删除子目录形式的URL我有一个URL结构,这样htaccess的:同时担任了原创内容
http://domain.com/page/thing1
http://domain.com/page/thing2
http://domain.com/page/thing3
我想:
- 删除/页/从URL
- 提供来自/ page/thing1的内容
我正在使用Exp ressionEngine,所以这里是我做什么,从URL
<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
你不一定必须通过ModRewrite要做到这一点,取决于你如何访问在EE这个数据。这些URL是否通过Pages模块创建?或者'page'是一个模板组,'thing1'是一个模板?或者是'thing1','thing2'等所有入口网址标题? – 2012-01-16 20:39:30
这里有两篇文章可能有助于http://stackoverflow.com/questions/2402140/use-a-subdirectory-as-root-with-htaccess-in-apache-1-3和http://stackoverflow.com/问题/ 990392/htaccess-rewrite-to-redirect-root-url-to-subdirectory – Anagio 2012-01-16 20:55:50
@DerekHogue现在我已经设置了页面是模板组,thing1和thing2是条目。 – Dan 2012-01-16 21:20:40