Info Pages - Pretty URLs

Ask the community for help and support.
LeeFoster
VIP Member
VIP Member
Posts: 228
Joined: Sun Feb 28, 2021 9:41 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Info Pages - Pretty URLs

Post by LeeFoster »

@zipurman my next step is to add the folder into the url so it would read /information/about/

Any thoughts on this?

Tags:
User avatar
villameschik
Posts: 58
Joined: Mon Jan 11, 2021 3:09 pm
Has thanked: 9 times
Been thanked: 2 times

Re: Info Pages - Pretty URLs

Post by villameschik »

zipurman wrote: Fri Mar 26, 2021 8:36 am
villameschik wrote: Fri Mar 26, 2021 8:33 am Hi zipurman, could this also work on the 1080 version?
This does work for the 1.0.8.0 version now.?¿
yes the latest version 1.0.8.0, does it work?
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 470
Joined: Tue Oct 13, 2020 5:20 pm
Has thanked: 84 times
Been thanked: 147 times

Re: Info Pages - Pretty URLs

Post by zipurman »

LeeFoster wrote: Fri Mar 26, 2021 9:59 am @zipurman my next step is to add the folder into the url so it would read /information/about/

Any thoughts on this?

You could edit the .htaccess to include the /:

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9\/]+) /info.php?pageis=$1 [L]
</IfModule>
You could then also update the hook to allow the / as well:

Code: Select all

<?php

    class hook_shop_system_infopages {

        function listen_startApplication() {

            if ( ! empty( $_GET ) && ! empty( $_GET["pageis"] ) ) {

                $slug = $_GET["pageis"];

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

                $page = tep_db_fetch_array( tep_db_query( "select * from pages where slug = '" . $slug . "'" ) );

                if ( ! empty( $page ) ) {

                    $_GET['pages_id'] = $page['pages_id'];

                } else {

                    tep_redirect( tep_href_link( 'index.php' ) );

                }

            }

        }

    }
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
Has thanked: 84 times
Been thanked: 147 times

Re: Info Pages - Pretty URLs

Post by zipurman »

villameschik wrote: Fri Mar 26, 2021 11:14 am yes the latest version 1.0.8.0, does it work?
All of my addons support 1.0.8.0 and I keep them up to date.
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
villameschik
Posts: 58
Joined: Mon Jan 11, 2021 3:09 pm
Has thanked: 9 times
Been thanked: 2 times

Re: Info Pages - Pretty URLs

Post by villameschik »

hi @zipurman
I installed on a clean version 1.0.8.0 TEST, I followed the instructions etc etc, it gives me an error Not Found, as soon as I modify /catalog .htaccess it takes me back to the home page of the main site.
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 470
Joined: Tue Oct 13, 2020 5:20 pm
Has thanked: 84 times
Been thanked: 147 times

Re: Info Pages - Pretty URLs

Post by zipurman »

I know it works on 1.0.8.0 for sure as it has nothing really to do with Phoenix ... it all happens at the top of the stack. The demo video was also done in 1.0.8.0.

If your store is running in a subfolder like catalog, then you would need to change the htaccess line:

Code: Select all

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

Code: Select all

RewriteRule ^([A-Za-z0-9\/]+) /catalog/info.php?pageis=$1 [L]
You can do some more reading on htaccess and RewriteRules on the web as there are so many things you can do with it.
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
villameschik
Posts: 58
Joined: Mon Jan 11, 2021 3:09 pm
Has thanked: 9 times
Been thanked: 2 times

Re: Info Pages - Pretty URLs

Post by villameschik »

Thanks, everything works perfectly now :D :D :D
admin
Site Admin
Site Admin
Posts: 139
Joined: Wed Oct 30, 2019 1:34 pm
Has thanked: 20 times
Been thanked: 21 times

Re: Info Pages - Pretty URLs

Post by admin »

Support for this Addon will now be available on the Addon page - app.php/addons/free_addon/info_pages_pr ... ls/support
Locked