Jump to content

URL rewriting


Recommended Posts

Hello,

 

1. Please first make sure you have mod_rewrite working:

- Create an empty file and name it info.php

- Paste this line into your new file:

<?php
phpinfo();

- Upload the file to your web store's webroot. (if you PS installation is under httpdocs/prestashop, upload this file under httpdocs/prestashop

- Call your file via your browser to display your php settings: http://your-ps-store.com/info.php

If you can see "mod_rewrite", you have mod_rewrite working.

 

2. Now that you are sure you have mod_rewrite working, this probably means your $_SERVER superglobal doesn't contain a key named "mod_rewrite".

This control is done under ps-installation-dir/classes/Tools.php, modRewriteActive() method.

You may override this method by opening /ps-installation-dir/override/classes/Tools.php

(most probably there is only the class definition there) and adding the manipulated method there so it will look like:


<?php

class Tools extends ToolsCore
{
public static function modRewriteActive()
{
	 return true;
   }
}

 

This will bypass the mod_rewrite control. Now you can retry whatever you were trying to do. If this will not work either, the problem is probably with your server. But if it will work this way, please also issue a bug report so the Prestashop team might take care of it for the upcoming releases.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...