web server upgrade broke SEO URLs

6 posts by 2 authors in: Forums > CMS Builder
Last Post: July 11, 2017   (RSS)

By Deborah - July 5, 2017

The server one of my client sites is hosted on was upgraded without our advance knowledge and it has broken any SEO-friendly links.

This link method longer works:
http://www.domain.com/classes/department.php/num-7/

... but the basic link method does work:
http://www.domain.com/classes/department.php?num=7

The CMSB documentation for SEO URLs states "This is not supported on all web servers." I can revert the urls to the basic format, but would prefer not to.

My question is, could this be remedied by asking the server admins to install or enable something for Apache or PHP?

~ Deborah

By Dave - July 5, 2017

Hi Deborah, 

Yes, there's an Apache directive for allowing what's called "PATH_INFO".  Here's the Apache docs: 
https://httpd.apache.org/docs/2.4/mod/core.html#acceptpathinfo

If your host lets you create .htaccess files, try adding this to an .htaccess file in the root of your website: 

AcceptPathInfo On

Or if that doesn't work you can ask them to add it to the Apache config file for your website.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

By Dave - July 6, 2017

Hi Deborah, 

Hmm, I'm not sure about that one.  It looks like it's hardcoded to work with specific filenames only.

I'd just google for: Nginx AcceptPathInfo

One of the first results has some generic code here: https://stackoverflow.com/a/30778310

But they'll need to try them and confirm it works. I think they can also pass certain requests (eg: php files) through to Apache.  I know we use Plesk and it comes bundled with nginx and Apache.  With static requests (images, etc) getting handled by nginx and dynamic pages such as php being handled by Apache. Reference: https://docs.plesk.com/en-US/onyx/administrator-guide/web-servers/apache-web-server-linux/apache-with-nginx.70837/

But we're getting into Server Admin issues here so I'm not the expert.  They should definitely be able to find a way to resolve it though as it's a common problem (as evidenced by the number of google posts about it).

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

web server upgrade broke SEO URLs - RESOLVED

By Deborah - July 11, 2017

Hi, Dave.

I forwarded your suggestions to the server admins and the server issue has been resolved!

The setup: NGINX 1.10.0 with an ISPConfig 3.1.2 control panel.

To allow for the SEO URLs, it was necessary to add in the ISPConfig redirect section the following rule:

rewrite (.*php)\/(.*)-([0-9]+) /$1?num=$3 break;

Not the most common hosting setup, but maybe someone else will encounter the same issue someday, so thought I'd share.

Thanks for your good advice! I think it probably helped the server admins arrive at this solution.

~ Deborah

web server upgrade broke SEO URLs - RESOLVED

By Dave - July 11, 2017

Thanks! Glad you got it working and thanks for sharing the code.  Cheers!

Dave Edis - Senior Developer
interactivetools.com