Info Pages - Pretty URLs

Open to all! Ask other shopowners for help.
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

Info Pages - Pretty URLs

Post by zipurman »

This hook allows you to use /catalog/pagename/ instead of /catalog/info.php?pages_id=x

https://phoenixaddons.com/knowledgebase ... etty-urls/
zipurman
-----------

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Info Pages - Pretty URLs

Post by radhavallabh »

Can this concept work for product urls too?
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 »

zipurman
-----------
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 »

I've just installed this on a local xampp install and it's not working, what am I missing?

I have dropped all the files in and edited the .htaccess file.
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: Thu Mar 25, 2021 3:45 pm what am I missing?
I need more info.
What page/slug are you trying to link to?
Are you trying to go to yourdomain.com/slug/ ?
What do you get as a result?
Did you watch the youtube video on how use this?
zipurman
-----------
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 »

The page is about us, the slug is about.
I am testing this on a local install so I am trying to go to 127.0.0.1/360v3/about
Result is 404 page not found.
Yes I did watch the video

I just found the issue, it is related to me being on a local install, /info.php?pageis=$1 needed to be 360v3/info.php?pageis=$1

I know this allows the use of /about or /shipping instead of /info.php?pages_id=4 but is there a way to get /info.php?pages_id=4 to change to /shipping when clicking an internal link?
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 »

Not as easy as htaccess has no way of knowing what slug belongs to pages_id=4

You could add some logic to the hook that checks if pages_id is loaded in the $_GET['pages_id'] and then load the slug and do a re-direct to the /slug/ using a header location. Just have to be careful not to create a recursive loop ;)
zipurman
-----------
villameschik

Re: Info Pages - Pretty URLs

Post by villameschik »

Hi zipurman, could this also work on the 1080 version?
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 8:33 am Hi zipurman, could this also work on the 1080 version?
This does work for the 1.0.8.0 version now.?¿
zipurman
-----------
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 wrote: Fri Mar 26, 2021 8:27 am Not as easy as htaccess has no way of knowing what slug belongs to pages_id=4
Shame as this would be more useful I suspect.
zipurman wrote: Fri Mar 26, 2021 8:27 am You could add some logic to the hook that checks if pages_id is loaded in the $_GET['pages_id'] and then load the slug and do a re-direct to the /slug/ using a header location. Just have to be careful not to create a recursive loop
Or change the way this link is written so the link is /shipping instead of /info.php?pages_id=4


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