Redirect Context adds "index.php" ???

#1
Hello,

I am trying to add a Redirect Context for "old.example.org" => "new.example.org", and i have this in my Redirect Context

URI : /
External: Yes
Status code: 301
Dest URI: http://new.example.org/

And, it works, i end up with a redirect, but i land on "new.example.org/index.php", which does not exist. (index.html exists thou).

What am i doing wrong??
 
#3
Hi Enthess,

Could you check your indexFiles setting? Does it have both index.php and index.html listed?
On where? the old, the new?
I know server general has both index.php and index.html

The new has
use server : no
index: index.html

old has
use server : no
index : index.php
 
Last edited:
#5
I found the solution!

Turn off Rewrite on "old" vhost.

Rewrite:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
 
#7
Enthess,

Are those rewrite rules also in the new vhost?
On new vhost i have these

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /api/public/index.php [L]

I have an API-framework in /api/public/ which i want it to listen for /api/-calls

Maybe rewriterule should be .^/api/ /api/public/index.php or something instead?
 
#9
Could you set rewrite logging to 9 on the new? It should say what URI the rule tried to switch from.
On the new vhost with old rewrite activated, i got this:

2016-11-02 16:25:07.684 [INFO] [:55840] [REWRITE] Rule: Match '/index.htmlindex.php' with pattern '.', result: 1
2016-11-02 16:25:07.684 [INFO] [:55840] [REWRITE] stat( /usr/local/lsws/vvDashboard/index.htmlindex.php ) failed
2016-11-02 16:25:07.684 [INFO] [:55840] [REWRITE] stat( /usr/local/lsws/vvDashboard/index.htmlindex.php ) failed
2016-11-02 16:25:07.684 [INFO] [:55840] [REWRITE] Source URI: '/index.htmlindex.php' => Result URI: '/api/public/index.php'
2016-11-02 16:25:07.684 [INFO] [:55840] [REWRITE] Last Rule, stop!
 

lsfoo

Administrator
#10
I see. So it looks like the redirect context got the old rewrites prior to redirecting. If those rewrite rules are not necessary, then turning them off should be sufficient.

Thanks for the heads up, we'll look into this :)
 
#11
I see. So it looks like the redirect context got the old rewrites prior to redirecting. If those rewrite rules are not necessary, then turning them off should be sufficient.

Thanks for the heads up, we'll look into this :)
Its not needed no more, its a 301-permanent redirect and i see no reason of why rewrite should be activated anymore. :)
 
Top