我有這個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