Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

shorten long url string

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
jase1
Smarty n00b


Joined: 13 Mar 2018
Posts: 4

PostPosted: Fri Sep 28, 2018 4:50 am    Post subject: shorten long url string Reply with quote

Hi,

This issue is driving me crackers.

I have a vast array of search pages on my site, each of which unfortunately produces very long URL strings, is there any way to shorten them? I've tried .htaccess but to no avail.

So I'm wondering whether it can be done either directly in the template file or via the php file.

EG of Current URL: www.website.com/holiday-homes.php?opt2=apartment&opt7=Yes&opt9=No&opt17=Yes

is there any way to strip out everything after the question mark but still carry out the search, so that it shows a neater URL of say..

www.website.com/holiday-homes.php

Cheers Jason.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sun Sep 30, 2018 12:01 pm    Post subject: Reply with quote

You have to write PHP code for that, Smarty is only presentation engine. It does not implement business logic or routing.
Back to top
View user's profile Send private message
jase1
Smarty n00b


Joined: 13 Mar 2018
Posts: 4

PostPosted: Mon Oct 01, 2018 4:33 am    Post subject: Reply with quote

Hi AnrDaemon, Thank you for replying, any thoughts as to how I would go about it?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Oct 01, 2018 2:27 pm    Post subject: Reply with quote

1. Read on request routing in PHP.
2. Implement one of the routers in your project.
3. Decide on new URL scheme.
4. Make it work.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP