简体   繁体   English

htaccess将wordpress重定向到index2.php

[英]htaccess redirect wordpress to index2.php

We have a site running on WordPress ada.localhost.com 我们有一个在WordPress ada.localhost.com上运行的网站

Now all request to base url ( http://ada.localhost.com/ ) have to go through tracking page (track.com/c/0912321323/?u=xxx) where u parameter is where to redirect user after he is tracked. 现在,所有对基本url( http://ada.localhost.com/ )的请求都必须通过跟踪页面(track.com/c/0912321323/?u=xxx),其中u参数是在跟踪用户之后将用户重定向到的位置。

I've created a copy of index.php (index2.php) and I want to create htaccess rule to redirect all base url traffic to: 我已经创建了index.php(index2.php)的副本,并且我想创建htaccess规则来将所有基本url流量重定向到:

http://track.com/c/0912321323?u=http%3A%2F%2Fada.localhost.com%2Findex2.html ( http://ada.localhost.com/index2.php ) http://track.com/c/0912321323?u=http%3A%2F%2Fada.localhost.com%2Findex2.htmlhttp://ada.localhost.com/index2.php

Typical WP htaccess file looks like this 典型的WP htaccess文件如下所示

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Any clue on how to set it up and if WordPress allow this configuration? 关于如何进行设置以及WordPress是否允许此配置的任何线索?

From what I found WordPress won't work with index2.php. 根据我的发现,WordPress无法与index2.php一起使用。 Solution for this is to write a plugin which deals with it. 解决方案是编写一个处理它的插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM