【发布时间】:2012-05-24 17:31:14
【问题描述】:
不想问这个问题,但我已经把头撞在桌子上一段时间了,似乎无法理解。我正在使用 ExpressionEngine,并且正在使用 mod_rewrite 从我的所有 URL 中删除 index.php。这很好用。此外,我希望将 myurl.com/adwords/(anything) 中的任何内容重写为 myurl.com/(anything)。我的正则表达式和 htaccess Skillz 很弱。这是我在 .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) 结尾的内容,捕获该内容,然后通过 $1 将其附加到 index.php 的末尾。我猜这很简单。谢谢!
【问题讨论】:
标签: .htaccess mod-rewrite expressionengine