In Hugo how do I get parameters to work like htaccess files?
I want this to go to
mysite.com/product/ and then somewhere on the page I can check if it exists and do something with it. If not exists show fallback.
Does this make sense?
That is something you do server side not with Hugo.
I gathered .htaccess is server side as its apache, I was asking for a similar approach in Hugo, is there one?
Nope. Hugo is just a generator.
Not exactly, but it depends on what you want to do with your
.htaccess-like file. Keep in mind you can write to any text-based file using custom outputs, so while Hugo just generates files and it’s up to you to decided on the server, you can use Hugo’s flexibility to your advantage. For example, with setting up redirects:
08:44AM - 20 Jun 17 UTC
Note that even with this setting enabled, the aliases themselves are preserved o
This is what I want to do and what I currently do in my htaccess.
mysite.com/about/careers -> mysite.com/about?p=careers
^not actual htaccess code but it highlights my desire.
This was, the page about is called, I have a script that tells me if p is set and get the value of p, then if p is careers I do something. The user sees in the address bar:
Also, I use htaccess to remove extensions like .php or html… Is this possible?
Did you try Hugo’s aliases?