This forum has moved to a new location and is in read-only mode. Please visit to access the new location.


Hello, I'm new to octoberCMS! Consider that I've been developing with other type of CMSes where they usually deal with urls automatically. So let's consider we have a website with Countries with their relative States and Cities. All of these of course use relationships in Models.

If I create this page with the url


I can easily access the content by querying the country slug


If I want to access the city of Philadephia I would have something like this


So this would work


BUT to make this actually work and unique you need to check that the Model "City" has that exact country and state connected to it. Otherwise if you only check the last parameters :city-slug this would create false or worse infinite duplicate content where every combination of state/country could work with Philadelphia so that this URL could work as well


Is this the correct way do it? So that every URL with multiple parameters needs to be checked manually in the backend? Or I missing something here? This method seems extremely complicated for very long URLs and not very practical for actual dynamic content.


Just use model relation queries as explained here:


$city = County::where('slug', $countrySlug)->first()
   ->states()->where('slug', $stateSlug)->first()
   ->cities()->where('slug', $citySlug)->first();

You may want to use/examine the Location Towns plugin as well:


Hi mjuavin, so it is correct I must check for every url the parameters to avoid duplicate content?

1-4 of 4

You cannot edit posts or make replies: the forum has moved to