Developer forum

Forum » CMS - Standard features » Product catalog module throws 404 if the url has a trailing slash

Product catalog module throws 404 if the url has a trailing slash

Davor Zlotrg
Reply

Hi, I have an issue with Product catalog module attached to a paragraph

 

http://myshop/category          - this is working fine and shows categories and products

http://myshop/category/         - this gives me 404

 

How can I fix this ?

Dynamicweb version is 8.3.1.8.

 

This is how my customized urls look like- picture attached

Untitled.jpg

Replies

 
Nicolai Høeg Pedersen
Reply

You cannot.

What problem are you trying to solve?

 
Davor Zlotrg
Reply

I have a setting on the website to go to the frontpage if page is not found.

So when the user comes with the url- myshop/category/ he is redirected to the fontpage and can not see the products or categories.

Shouldn't it do 301 redirect to myshop/category because for content pages I get that functionality, if i go to myshop/aboutus/ it gives 301 redirect to myshop/aboutus

 
Nicolai Høeg Pedersen
Reply

Maybe it should.

But would your users get to myshop/category/ if you never published that URL?

Anyways - changed Dynamicweb so it behaves the same when using extension less URLs - so anything ending with / is 301'ed to same URL without /

Out in 8.5

 
Davor Zlotrg
Reply

Ok thanks, one more question:

 

I installed isapirewrite because I want to redirect some pages but when the page is not found it redirects me with the query string and it gives me issues.

for example

 

RewriteRule /test /webshop [NC,R=301,L]

when I go to /test I get this /webshop?404%3bhttp://myshop/test           and for some reason I get 404 even thourh it is a vaild url (webshop)

 

I noticed there is direct path module, and I could use it if it supported regex (I have a lot of dynamic content to redirect so writing it manually is not an optoin).

Can I use regex in direct paths, and if not, is there a way to fix 301 redirects not to include query string?

 

Thanks in advance. 

 
Nicolai Høeg Pedersen
Reply

Direct path does not support regex currently.

Which version are you running on? If I go to myshop/somethingThatDoesNotExist I just get a normal 404.

 
Davor Zlotrg
Reply

The version is  8.3.1.8.

 

I get a normal 404 for normal pages, but when I have a redirect in isapirewrite for a specific page, something like

RewriteRule /test /somethingThatDoesNotExist [NC,R=301,L]

and I visiti myshop/test, I get redirected correctly to somethingThatDoesNotExist but with the query string somethingThatDoesNotExist?404%3bhttp://myshop/test and in that case even if  somethingThatDoesNotExist page exists on the server it will still give me 404.

 

 
Nicolai Høeg Pedersen
Reply

Can't help... Do not know where it comes from.

 

You must be logged in to post in the forum