【发布时间】:2012-03-10 17:44:13
【问题描述】:
我的主题上有一个自定义页面,根据给定的参数显示不同。该页面被设置为网站的主页。 有效参数组合如下:
my_domain/?fa={action}&type={type}
my_domain/?fa={action}&id={type}
my_domain/?fa={action}
我正在尝试将这些链接转换为以下内容:
my_domain/fa/{action}/type/{type}
my_domain//fa/{action}/id/{type}
my_domain/fa/{action}
我的 .htaccess 文件现在看起来像这样,但它似乎不起作用:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^fa/(.*)/type/(.*)$ /index.php [L]
RewriteRule ^fa/(.*)/id/(.*)$ /index.php?fa=$1&fid=$2 [L]
RewriteRule ^fa/(.*)$ /index.php?fa=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
我在这里做错了什么?
谢谢, 拉度
【问题讨论】:
标签: apache wordpress .htaccess mod-rewrite