下面是我在我的htaccess现在:如何正确重定向多个URL用的.htaccess
Options +FollowSymlinks
RewriteEngine on
RewriteBase /themelink/mytheme
RewriteRule ^(.+)$ http://portal.example.com/aff.php?aff=$1&p=mytheme.php [R=301,NC]
我有这样的.htaccess地处/themelink/mytheme
目录。
这样做是重定向有人去http://example.com/themelink/mytheme/123456
到URL http://portal.example.com/aff.php?aff=123456&p=mytheme.php
这几乎是我想要做的,但在那里我想它但它不是相当。
我想要做的是将.htaccess放在我的themelink
目录中,并让它识别URL后面的任何文件夹名称,而不必为每个主题创建单独的文件夹。
例如,这里的几集的链接,我想工作:
http://example.com/themelink/new-theme/5643434
---> http://portal.example.com/aff.php?aff=5643434&p=new-theme.php
http://example.com/themelink/bloggertheme/254543
---> http://portal.example.com/aff.php?aff=254543&p=bloggertheme.php
http://example.com/themelink/test-theme/4353663
--- > http://portal.example.com/aff.php?aff=4353663&p=test-theme.php
我可以在技术上做到这一点只是c为每个需要重定向设置的主题重新创建一个新目录,并仅使用上面的.htaccess,但我更愿意拥有一个仅适用于所有主题的.htaccess。
希望这是有道理的,请随时让我知道是否需要澄清。