You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to make a website available using two different URLs patterns: domain.com and domain.com/city_code.
My approach currently is to use an index.php and a ny/index.php. I've split my configurations and variables on both index.php files and the config.php. But I still need to update the NGINX configuration file, coding a new location directive for every new city.
Before I lose control of everything, please, is it possible to achieve this using Resource Router?
I tried using the following code, but it doesn't look enough:
$config['resource_router'] = array(
'(sp)/:any/:any' => function($router, $wildcard_1, $wildcard_2) {
$router->setTemplate( $wildcard_1.'/'.$wildcard_2 );
$assign_to_config['global_vars']['cv-city_segment'] = "sp";
$assign_to_config['site_url'] = '/'.$assign_to_config['global_vars']['cv-city_segment'];
$assign_to_config['global_vars']['cv-city_ch_blog_id'] = "";
$assign_to_config['global_vars']['cv-city_ch_events_id'] = "";
$assign_to_config['global_vars']['cv-city_cat_blog_id'] = "";
// a different variable, so we can change the city segment easier, if needed$assign_to_config['global_vars']['cv-city_code'] = 'sp';
}
);
Thank you!
The text was updated successfully, but these errors were encountered:
Hi!
I need to make a website available using two different URLs patterns:
domain.com
anddomain.com/city_code
.My approach currently is to use an
index.php
and any/index.php
. I've split my configurations and variables on bothindex.php
files and theconfig.php
. But I still need to update the NGINX configuration file, coding a newlocation
directive for every new city.Before I lose control of everything, please, is it possible to achieve this using Resource Router?
I tried using the following code, but it doesn't look enough:
Thank you!
The text was updated successfully, but these errors were encountered: