eZ Community » Forums » General » Auto Redirect modul not found pages...
expandshrink

Auto Redirect modul not found pages to one static page

Auto Redirect modul not found pages to one static page

Thursday 06 February 2014 9:30:20 am - 10 replies

Hi to all!

I have one little bit complicated issue. On my site i have cars list for sale. URL for cars goes like
mysite.com/cars/nameofcar1
mysite.com/cars/nameofcar2
mysite.com/cars/nameofcar3

When my nameofcar3 for example is sold out i erase car but link mysite.com/cars/nameofcar3 is now Module Not Found Page.

I want to make some module in Apache that will recognize my ModuleNotFound page for cars and all those pages in future to be redirected to some static page mysite.com/cars/SoldOutPage on which i would have some random text "Sorry this car is Sold Out" with link to my inventory list.

This look like the easiest way but if you have any other idea can you please point me in right direction.

Thanks in advance!

Modified on Thursday 06 February 2014 9:31:59 am by Zila Stu

Thursday 06 February 2014 10:03:28 am

You should be able to do the manual redirection of a certain url with the "URL wildcards" feature in Setup.

To automatically do this you need to build a simple module that can figure out "Module not found" in the Cars context and do the redirection. You can configure the error handling (redirect your simple module when the error happens) via error.ini settings.

Hope this helps

Friday 07 February 2014 12:22:38 pm

Hi Ivo, thanks for reply!

I was using URL wildcards till now, and i want to make this job to be little bit more automatically, but I am not that kind good.

You give good point for solution. I found documentations how to configure new rule in error.ini settings. I found its should be:
ErrorHandler[20] = /cars  - in my case.
But I want to redirect module not found pages for mysite.com/carsModuleNotFound not for all pages on my site.
What should I put for Setting Value when i make new setting in this case?
Sorry for being wasting your time but I am really stuck on this one, and I see you have a lot of experience in eZ.
Thanks again!

Friday 07 February 2014 12:38:18 pm

Quote from Zila Stu :

You give good point for solution. I found documentations how to configure new rule in error.ini settings. I found its should be:

ErrorHandler[20] = /cars  - in my case.
But I want to redirect module not found pages for mysite.com/carsModuleNotFound not for all pages on my site.
What should I put for Setting Value when i make new setting in this case?
Sorry for being wasting your time but I am really stuck on this one, and I see you have a lot of experience in eZ.
Thanks again!

The missing part would be the simple module which needs to be implemented. It would be called for ErrorHandler[20] and it would figure out what happens next: to show the error or redirect to some custom page depending on the requested url. There is no native feature for this, I am afraid.... 

Friday 07 February 2014 3:43:31 pm

Ok.

Than i will redirect all  Module Not Found pages to one single page mysite.com/PageWithSimpyInformations

In my error.ini settings i have

ErrorHandler   default
default
[0][1] embed

I try to use commands to do ErrorHandler[20]=/PageWithSimpyInformations but i cant resolve this.

I know that this is beginner stuff but can you explain it step by step i don't want to crash my site.

I would really appreciate!

Friday 07 February 2014 4:14:10 pm

Quote from Zila Stu :

I try to use commands to do ErrorHandler[20]=/PageWithSimpyInformations but i cant resolve this.

I know that this is beginner stuff but can you explain it step by step i don't want to crash my site.

I would really appreciate!

Try it like this:

ErrorHandler[20]=redirect
RedirectURL[20]=/PageWithSimpyInformations

Clear ini caches afterwards

Modified on Friday 07 February 2014 4:17:19 pm by Ivo Lukač

Monday 10 February 2014 10:27:49 am

I just try to change this but i got error.

Fatal error: eZ Publish did not finish its request

The execution of eZ Publish was abruptly ended. Contact website owner with current url and what you did, and owner will be able to debug the issue further.

My site is working good but now i cant access to error.ini

Is there any way to fix this?

Monday 10 February 2014 12:08:44 pm

Quote from Zila Stu :

I just try to change this but i got error.

Fatal error: eZ Publish did not finish its request

The execution of eZ Publish was abruptly ended. Contact website owner with current url and what you did, and owner will be able to debug the issue further.

My site is working good but now i cant access to error.ini

Is there any way to fix this?

Why are you not able to access error.ini? 

Monday 10 February 2014 12:43:00 pm

I just got this message nothing else. I can access all others .ini files, but i cant only to error.ini

Monday 10 February 2014 12:51:36 pm

Quote from Zila Stu :

I just got this message nothing else. I can access all others .ini files, but i cant only to error.ini

You are accessing it via admin interface? You don't have some other way to access it  like ssh or ftp?

Monday 10 February 2014 12:55:52 pm

I access via admin interface when i wanted to try changes and then it happen, but i have ssh access too.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from