Jump to content

[SOLVED] [Debug] This page has moved


Recommended Posts

To follow up on this thread which has been locked on me so I can't respond:

 

http://www.prestashop.com/forums/topic/285182-solved-url-rewriting-error-debug-this-page-has-moved/?do=findComment&comment=1478673

 

The final solution, instead of just masking the problem by turning debug off is as follows.

 

Apparently, when running an Apache server with CGI/FastCGI, PHP is unable to detect whether or not mod_rewrite is enabled. If debug mode is enabled, like this:

 

define('_PS_MODE_DEV_', true);


in config/defines.inc.php

 

... you might come across an error message like this when the browser is being redirected after making a purchase or perhaps when clicking a link in an email sent from Prestashop

 

[Debug] This page has moved
Please use the following URL instead:

 

Researching this, the solution often given is to simply turn off debug mode. Sure it works, but it does so by hiding the problem. Not actually solving it.

 

If you want to be able to turn on debug mode, and not have that error appear and have the browser correctly redirected, (if you are using Apache CGI/FastCGI) then you'll need to place this:
 

<?php
class Tools extends ToolsCore
{
  // since mod_rewrite is not detectable with CGI/FastCGI
  // and we know it actually is working, just force true
  // to be returned
  public static function modRewriteActive()
  {
    return true;
  }
}

?>

 

in overrides/Tools.php, and then delete cache/class_index.php (otherwise the override won't be noticed)

 

That is the solution.

 

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

I use this post because i thing its the same problem. I have a module xml export. The output of the product url is this .... http://www.urbanfashion.gr/529--victory-greenwich-dark-blue.html When i use this url i take this error "[Debug] This page has moved

Please use the following URL instead: http://www.urbanfashion.gr/529-envy-argentina-vermoudes-prosfora-victory-greenwich-dark-blue.html" . According that post i tested to make define('_PS_MODE_DEV_', false); And yes it works now. The export continue to give the first url but imediately redirects to second url wich is the right url. As i read it is not the appropriate solution because it is just cover the problem and not solve it. My questions are.

1) As described above in my 1.6 prestashop there is no  tools.php file in override folder. Where can i go to change that code that describes

2) Why happened this? How can i have the original url without redirection? Is it something with seo and urls? Please answer my questions because i can not upload my store in important advertisment portals. 

Link to comment
Share on other sites

1) gergos, you have to create the tools.php file in the overrides directory.

 

2) Beyond what I've explained in my solution, I don't understand why this change is necessary, but it does seem to be necessary.

I delete {meta_keywords} from url architecture and it play nice. Do you thing that i still need to create a file with the above code in overrides folder? Thank you very much for your answer.

Link to comment
Share on other sites

×
×
  • Create New...