sitemap  |  contact

Sakic.Net Forum
07 January 2009, 20:46 *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Introducing AJAX Scroller - Joomla News Slider Module: http://www.sakic.net/news/introducing_ajax_scroller/
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: PHP pages other than index.php give a 301 redirect error  (Read 1165 times)
benmcntsh
Newbie
*
Posts: 5


View Profile
« on: 11 August 2008, 01:08 »

Hello,

I have SEF Advance 1.5.7 installed and running great. The only problem is that I have a couple of other php files in the root directory of my website that I need to access, but when SEF Advance is enabled, I get a 301 redirect error and it pushes me to the home page.

For example I have a custom php page that requests an image to be displayed:

https://www.picturefixerpro.com/upload.php?task=viewimage&name=jack_nicholson.jpg

With SEF Advance off, the image is displayed fine. With SEF Advance on, I get a 301 response and I'm pushed to the homepage immediately.

How can I prevent this?

Thanks,
Ben
Logged
Saka
Administrator
Hero Member
*****
Posts: 1,351


View Profile WWW
« Reply #1 on: 11 August 2008, 05:16 »

Requests to existing files should not be forwarded to SEF Advance. Perhaps your .htaccess file is wrong. I suggest you send a mail with access info to your site so I can have a look.
Logged

benmcntsh
Newbie
*
Posts: 5


View Profile
« Reply #2 on: 11 August 2008, 06:00 »

Thanks very much for the reply. I started digging in and came up with the following php code that causes the problem. This code was in upload.php, part of an AJAX uploader that someone coded for me.

Code:
<?php
define
'_JEXEC');
define('JPATH_BASE'dirname(__FILE__) );
define'DS'DIRECTORY_SEPARATOR );
require_once ( 
JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( 
JPATH_BASE .DS.'includes'.DS.'framework.php' );

// CREATE THE APPLICATION
$mainframe =& JFactory::getApplication('site');

// INITIALISE THE APPLICATION
$mainframe->initialise();
JPluginHelper::importPlugin('system');

// trigger the onAfterInitialise events
$mainframe->triggerEvent('onAfterInitialise');

// ROUTE THE APPLICATION
$mainframe->route();
?>

It looks like the $mainframe->route() call is what causes the problem. When running this code from a file (test.php) with SEF Advance on, I get pushed to the home page. With SEF Advance off, I get a blank page that stays at test.php in the address bar.

Can you give me some insight as to what is happening? It is definately something with SEF Advance and unfortunately my php skills are only mediocre. I guess the route() is sending the page to SEF Advance? Can I tell SEF Advance to ignore this page?

Thanks very much.
Logged
benmcntsh
Newbie
*
Posts: 5


View Profile
« Reply #3 on: 11 August 2008, 06:19 »

I fixed the problem temporarily by commenting out the $mainframe->route() line. Do you think that will have any adverse effects?
Logged
Saka
Administrator
Hero Member
*****
Posts: 1,351


View Profile WWW
« Reply #4 on: 11 August 2008, 07:28 »

It's obviously a copy of Joomla's index.php file. If that's just an upload page there should be nothing to route so you are fine with commenting that line out.
Logged

benmcntsh
Newbie
*
Posts: 5


View Profile
« Reply #5 on: 11 August 2008, 07:37 »

Great. Thanks again for the quick replies and great product.
Logged
Pages: [1]
  Print  
 
Jump to: