Question

We have many different departments, who have their own custom abbreviation. For example: ga, de, ka-da. Every department has its own custom logo and intro text. I would like to achieve, that there is only one single front-page and f.e. one single contact page, but the logo and text which should appear is depending on the abbreviation. (Not like multi-language plugins // Only one single page which has multiple fields for each department made with ACF PRO)

https://url.de/ --> show front-page
https://url.de/ga/ --> show front-page, but let me get the /ga/ as an var, so i can adapt the logo and text
https://url.de/contact/ --> show contact-page
https://url.de/ga/contact/ --> show the contact-page, but let me get the /ga/ as an var, so i can adapt the logo and text

I tried using the following code to test the redirect in generell, but i am not sure if this is the right way to achieve what i need.

global $post;
add_rewrite_rule( '^ga\/(.*)\/?', "index.php?page_id={$post->ID}", 'top' );

I always get an 404.
Any ideas how to get this work? Thanks!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top