mod rewrite.htaccess expressionengine remove index.php和特定子目录

mod rewrite.htaccess expressionengine remove index.php和特定子目录,.htaccess,mod-rewrite,expressionengine,.htaccess,Mod Rewrite,Expressionengine,我不想问这个问题,但我已经把头撞在桌子上好一阵子了,似乎没法理解。我正在使用ExpressionEngine,我正在使用mod_rewrite从我所有的URL中删除index.php。那很好。此外,我希望将myurl.com/adwords/(任何内容)重写为myurl.com/(任何内容)。我的正则表达式和htaccess技能很弱。以下是我在.htaccess中的内容: Options +FollowSymlinks RewriteEngine On RewriteBase / Rewrit

我不想问这个问题,但我已经把头撞在桌子上好一阵子了,似乎没法理解。我正在使用ExpressionEngine,我正在使用mod_rewrite从我所有的URL中删除index.php。那很好。此外,我希望将myurl.com/adwords/(任何内容)重写为myurl.com/(任何内容)。我的正则表达式和htaccess技能很弱。以下是我在.htaccess中的内容:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^/adwords/(.*)$
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

所以我想我说的是以/adwords/(something)结尾的任何内容,捕获something,然后通过$1将其附加到index.php的末尾。我猜这很简单。谢谢

您正在寻找的规则可能只是

RewriteRule ^adwords/(.*)$ index.php/$1 [L]
不需要重写条件,但我想知道。。。你真的想重写到,而不是重写到

如果还想重写类似的内容,则必须省略^:

RewriteRule adwords/(.*)$ index.php/$1 [L]

顺便说一句,你可以在这里测试你的大部分重写规则:

哇,那个网站太棒了。解决了我的问题。非常感谢!