Score:0

Rewrite subdirectory to root (Apache)

se flag

We have a mod_rewrite question here about going from subdirectory to "root"

Here are a few strings :

  • /fr/spil/spil-til-pc/steam/publisher/dovetail-games
  • /fr/spil/franchise/little-nightmares/little-nightmares-complete-edition
  • /fr/spil/franchise/south-park/south-park-the-fractured-but-whole-gold-edition

This is just a few of the paths, what we like to do is to "remove" the subdirectory and take the last part of the url and use that. So all this urls will be transformed to this :

  • /fr/publisher/dovetail-games
  • /fr/little-nightmares-complete-edition
  • /fr/south-park-the-fractured-but-whole-gold-edition

If the url contains /publisher/* then we need to keep the /publisher/* in the return.

Any able to help us here?

We have been looking a lot in the forum here, and dident find anything useful, that did solve this for us

kz flag
To clarify, your current application is expecting URLs of the form `/fr/publisher/dovetail-games` and `/fr/little-nightmares-complete-edition`? And this is the URL you are linking to internally? And you just need to (externally) redirect from the former/old URL to the later/new URL? Where exactly (in the Apache config) are wanting to implement these rules?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.