A
A
Alexander2020-06-09 12:17:52
WordPress
Alexander, 2020-06-09 12:17:52

How to implement subdomains through folders in wordpress?

Task: make regions for the information site through folders in the URL (note: site.ru - domain, site.ru/msk - region).

Of the solutions, multisite is the first to be pushed to the head, but multisite will create tables in the database for each region. If you need to change a post, you will have to change it for each site. Okay, there is a plugin for clones. But there is contact form 7 which is not cloned. And then there are a lot of problems with editing content in all regions, including the main domain.
Bottom line: multisite is not an option.

I would like a simple solution, as if I were doing it through 3rd level domains. You create a table for the regions, write a class for pulling up information on the region (contacts, phone numbers, addresses, meta tags) and insert the variable into the template.

Ideally, I have one table in the database with regions and info on them. A class for determining the current region and returning information about it in a variable.

Question, actually: how to implement it? Intervene in the router and change the url?

I do not need a ready-made implementation, I just want to understand in which direction to think. Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question