我创建了一个url shortener,使用.htaccess文件来重定向流量, 我把文件放在一个名为urls的子目录中,所以在我生成一个url之后链接会变成这样的东西
www.homepage.com/urls/i74a
现在我想将文件移动到主文件夹,以便生成的URL看起来像这样 www.homepage.com/i74a
但我的问题是我安装了WordPress并且他们有自己的.htaccess和一些规则。
是否可以将这两者结合起来?
我在想这样的事,但我不能让我工作。
的.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
#Begin SHORTENER#
Options +FollowSymLinks -Indexes -MultiViews
RewriteRule ^url\.php$ - [L]
RewriteRule ^([\w\d]{4})$ redirect.php?code=$1 [L]
#END SHORTENER#