Info Pages - Pretty URLs

Open to all! Ask other shopowners for help.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
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:


Join The Code Co-op to get access to your library in the Code Co-op Forum
villameschik

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
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 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
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 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
-----------
villameschik

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
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 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
-----------
villameschik

Re: Info Pages - Pretty URLs

Post by villameschik »

Thanks, everything works perfectly now :D :D :D
admin
Contributor
Posts: 217
Joined: Wed Oct 30, 2019 1:34 pm
Phoenix Version:
Has thanked: 20 times
Been thanked: 22 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
Locked