Upgrading PHP on my site and a rewrite rule broke

Viewed 17

I have a site that has news articles. In the DB, I have a 'slug' (e.g. 'my-news-item') column as well as an 'id' (e.g. '58') column. I used to be able to travel to the display page of the news item and have the URL format like:

https://[site_url]/recent_news/my-news-item

Since upgrading the version of PHP on the site, it has stopped working. My .htaccess is the same, I'm wondering if something needs to be updated.

AddHandler php-legacy .php
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteRule ^recent_news/(\w+)/$ /recent_news/index.php?slug=$1 [QSA,NC]
RewriteRule ^(recent_news/\w+)$ /$1/ [R=301]
AddHandler php-stable .php

Any help would be greatly appreciated!

1 Answers

Thank you all... I have realized from some of the answers here that my problem has nothing to do with the .htaccess file at all.

I had a PHP function that needed to be reworked in order to extract the id. Once I did that, everything worked as expected.

Related