How to fix this URL rewrite
===



My client has a wordpress site at http://civilnodrustvo.org.rs

On that site my client has a PHP app at http://civilnodrustvo.org.rs/upitnik

The app worked perfectly on the old server, but after migration it won't.

Main (WP .htaccess) looks like this:

    # 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

and the /upitnik/ .htacces looks like this:
    
    RewriteEngine On
    RewriteBase /upitnik/
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]

And it gives me an infinite redirect loop.

index.php of the php app looks looks something like this:

    if( empty($page->url) or $page->url == 'index.php') { //home page

		$page->redirect('organ');

	// -------------------------------------------------------------------
	} elseif( $page->url == 'test' ) {

		require MODULES_DIR . 'test.inc.php';
	// -------------------------------------------------------------------
	} elseif( $page->url == 'organ' ) {

		require MODULES_DIR . 'ank/organ.inc.php';
	// -------------------------------------------------------------------
	} elseif( $page->url == 'konkurs' ) {

		require MODULES_DIR . 'ank/konkurs.inc.php';
	// -------------------------------------------------------------------
	} elseif( $page->url == 'program' ) {

		require MODULES_DIR . 'ank/projekat.inc.php';

So basically it detects the state of the app and then redirects according to that.

I did not write the app, and I would rather not edit it.
Since the redirection worked ok on the old server and now it doesn't I need to know how can i fix it so it works.

I tried adding a / after . on upitnik .htacces file but it doesn't work. It gives me a WP-404 page.

 