|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jase1 Smarty n00b
Joined: 13 Mar 2018 Posts: 4
|
Posted: Fri Sep 28, 2018 4:50 am Post subject: shorten long url string |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sun Sep 30, 2018 12:01 pm Post subject: |
|
|
You have to write PHP code for that, Smarty is only presentation engine. It does not implement business logic or routing. |
|
Back to top |
|
jase1 Smarty n00b
Joined: 13 Mar 2018 Posts: 4
|
Posted: Mon Oct 01, 2018 4:33 am Post subject: |
|
|
Hi AnrDaemon, Thank you for replying, any thoughts as to how I would go about it? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Oct 01, 2018 2:27 pm Post subject: |
|
|
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 |
|
|
|
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
|