Jump to content

[SOLVED] "URL rewriting (mod_rewrite) is not active on your server." using CGI/FastCGI


Recommended Posts

URL rewriting (mod_rewrite) is not active on your server. If you want to use Friendly URLs you must activate this mod.

Hi, PS (Tools::apacheModExists) checks if PHP has enabled mod_rewrite. If you run PHP in CGI/FastCGI mode, PS does not detect it.

 

If you are sure that mod_rewrite works, you can override Tools::apacheModExists:

 

class Tools extends ToolsCore
{
 public static function apacheModExists($name)
 {
return true;
 }
}

 

Cheers,

Patrick

Edited by puecher (see edit history)
  • Like 1
Link to comment
Share on other sites

 

Hi, PS (Tools::apacheModExists) checks if PHP has enabled mod_rewrite. If you run PHP in CGI/FastCGI mode, PS does not detect it.

 

If you are sure that mod_rewrite works, you can override Tools::apacheModExists:

 

class Tools extends ToolsCore
{
 public static function apacheModExists($name)
 {
return true;
 }
}

 

Cheers,

Patrick

 

Where do i put this code?

 

Thank in advanced

Link to comment
Share on other sites

  • 2 weeks later...

Where are these files located? I've run into this error but I'm completely lost with your explanation. Where do I find all these things?

Create a file called tools.php containing the code that I posted and upload the file to override/classes/tools.php.

Link to comment
Share on other sites

Create a file called tools.php containing the code that I posted and upload the file to override/classes/tools.php.

i got error class Tools extends ToolsCore { public static function apacheModExists($name) { return true; } }

 

and can not access my website else!!

 

Help! Please

Edited by jesen (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

Go to file /override/classes/tools.php

 

replace:

<?php
class Tools extends ToolsCore
{
}

 

with this:

<?php
class Tools extends ToolsCore
{
 public static function apacheModExists($name)
 {
    return true;
 }
}

 

go back to admin, select SEO & URLs from preferences, click on the save button.

 

Finish

  • Like 3
Link to comment
Share on other sites

  • 5 months later...

Go to file /override/classes/tools.php

 

replace:

<?php
class Tools extends ToolsCore
{
}

 

with this:

<?php
class Tools extends ToolsCore
{
 public static function apacheModExists($name)
 {
	return true;
 }
}

 

go back to admin, select SEO & URLs from preferences, click on the save button.

 

Finish

 

Unable to find this in the told file. Please help. This issue is still not resolved in my PS1.5.4.1

Link to comment
Share on other sites

  • 1 month later...

I searched for the file tools.php and I do not have one. So I created a php file with the code given above. I put it into override/classes/tools.php and it did not work. I actually have two paths for override/classes/ so I added it in both. This still doesn't work and I still get the "URL rewriting (mod_rewrite) is not active on your server, or it is not possible to check your server configuration. If you want to use Friendly URLs, you must activate this mod." message next to the Friendly URL in my prestashop 1.5.

 

Okay, I got this message to go away, by refreshing my File Manager. But then all the images turned to "?."

 

To fix "?" images, check out other posts on that topic.

Edited by generalexperts (see edit history)
Link to comment
Share on other sites

I did it and does not Work! I Still get the message:

Reescrita de URL (mod_rewrite) não está ativo no seu servidor, ou não é possível verificar a configuração do servidor. Se você quiser usar URLs amigáveis ​​você deve ativar este mod

 

My language is BR.

Link to comment
Share on other sites

Never_give_up, I looked for a "tools.php" file in the /override/classes folder and couldn't find one, so I tried creating one with just your code in it and it makes no difference. I also tried renaming "tools.php" to "Tools.php" to match the name of the file I found in the /classes folder, but this didn't help.

 

Out of curiosity, I modified /classes/tools.php to add your code, but that just breaks the back end altogether.

 

Any other ideas? This whole "friendly URL" issue seems to be a huge pain for all!

 

Steve

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Hi,

I am new to PrestaShop and currently using PrestaShop version: 1.5.4.1. Instead of apacheModExists I have overridden with modRewriteActive(). It works fine for me. Let us know whether it will affect other functionality in PrestaShop

<?php

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

?>

Link to comment
Share on other sites

  • 1 month later...
Guest D_Frost

Hello,

 

im hosting PS 1.5.5 on a Strato Server and I can not get the URL rewriting to work using your suggestions. Any suggestions for me?

 

Greetings

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 1 month later...

Hello,

 

Please help. my site can not acsess for www. but it can be acessed frfom no www

note : please forgive me if this question is not for this thread.

regards

 

HI, the same problem for me. Have you found the solution yet?

Link to comment
Share on other sites

  • 1 year later...

How to check mod_rewrite enable or not.

 

 

 

I have check php information there are only 3 rewrite option - Please check below - and tell me mod_rewrite enable on not on my server. 

 

_ENV["IIS_UrlRewriteModule"] 7.1.0761.0

 

url_rewriter.tags a=href,area=href,frame=src,input=src,form=,fieldset=

a=href,area=href,frame=src,input=src,form=,fieldset=

 

_SERVER["IIS_UrlRewriteModule"] 7.1.0761.0

 

 

Thanks,

Somit

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...