Info Pages Pretty URLs

If the slug includes dash or underscore - Info Pages Pretty URLs

If the slug includes dash or underscore

by yeno » Thu Jul 28, 2022 1:03 am

Info Pages Pretty URLs ver. 1.0.0 allows to use only one-word slug.
Sometimes might be useful to use something like
example.com/info-page-name
or
example.com/info_page_name

1) /.htaccess

Find

Code: Select all

RewriteRule ^([A-Za-z0-9\/]+) /info.php?pageis=$1 [L]
Replace with

Code: Select all

RewriteRule ^([a-zA-Z0-9\/\-_]+) /info.php?pageis=$1 [L]
2) /includes/hooks/shop/system/infopages.php

Find

Code: Select all

                $slug = preg_replace( '/[^a-zA-Z0-9\/]/', '', trim( $slug ) );
Replace with

Code: Select all

                $slug = preg_replace( '/[^a-zA-Z0-9\/\-_]/', '', trim( $slug ) );
yeno
Posts: 5
Joined: Sat Dec 12, 2020 1:48 pm
Contact:

Re: If the slug includes dash or underscore

by zipurman » Thu Jul 28, 2022 3:52 am

For sure! This was only meant to show what is possible and how to do it. Adapt to suit your needs :)
zipurman
aka Preston Lord
-----------
Happy to help where I can ;)

https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
Image
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 470
Joined: Tue Oct 13, 2020 5:20 pm
Contact: