我有这个htaccess代码。我想做到的是能够将请求重定向到/约和/学习到/ wordpress的文件夹的内容,而不改变地址栏.htaccess代码重定向不改变URL
#Rewrite engine rules
RewriteEngine on
RewriteBase/
RewriteCond $1 !^(index\.php|import\.php|geocode\.php|robots\.txt|BingSiteAuth\.xml|y_key_88c0d00f4917d584\.html|favicon\.ico|images|img|uploads|css|js|topics|wordpress)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteRule ^about$ /wordpress [L]
RewriteRule ^learn$ /wordpress [L]
与/内容作为Web根目录的结构如下:
/content
/wordpress
index.php (the wordpress index.php)
.htaccess (the one we are editing)
index.php (the codeigniter index.php)
但是,htacess代码不起作用。
我可以使用Wordpress的htaccess而不是重定向/学习和/ about。顺便说一下,你的答案不起作用。 – yretuta 2011-06-12 20:49:03
重定向仍然由RewriteRule处理,即使在移动RewriteRule(s)for/about和/或学习之后,所有对index.php的请求都会通过。 – yretuta 2011-06-12 20:50:36
如果在Wordpress文件夹中有一个.htaccess文件, t甚至在使用/ wordpress时使用 - 所以没有任何东西可以使它在根.htaccess中工作。但是,是的,你可以将重写转移到你的WordPress的.htaccess相反 - 但我认为wordpress已经通过配置支持SEO的URL? – 2011-06-12 20:51:21