One additional primary search function. One other feature that we would like to include – if it can be done relatively easily - is that if someone enters in any location description (Zip, City Name, State Name) right after the main USMarriage.org URL name and a forward slash (such as “demonetprojects.com/usmarriage/Florida” or “demonetprojects.com/usmarriage/Jacksonville”) that the information after the forward slash be interpreted by the system as providing the “Location” information for the search. So, using the first of the above two examples, if someone types in the URL “demonetprojects.com/usmarriage/Florida” in their browser’s main search bar, that they be taken to the USMarriage.org website and shown a map of Florida, with a list of upcoming Marriage programs listed and displayed on a map of Florida. This feature would give a more local “feel” to the use of the national website.

Dani AI

Generated

Quick summary and recommendation: implement this inside concrete5 as a single-page handler that accepts an optional trailing segment (cleanest, integrates with c5’s routing and permissions), or — if you must — register a custom route that captures the rest of the path, or use an .htaccess rewrite as a last resort. The single-page/controller approach is the safest for long-term maintenance. Concrete CMS single‑page controllers. (documentation.concretecms.org)

Practical, minimal single‑page controller (recommended). Create the view at application/single_pages/usmarriage.php and the controller at application/controllers/single_page/usmarriage.php. Example controller skeleton:

<?php
namespace Application\Controller\SinglePage;
use Concrete\Core\Page\Controller\PageController;

class Usmarriage extends PageController
{
    public function view($location = null)
    {
        $location = $location ? trim(urldecode($location)) : null;
        $this->set('location', $location);
        // geocode $location, build query for events, set map center/markers
    }
}

This lets URLs like /usmarriage/Florida or /usmarriage/Jacksonville map directly to $location. See single‑page controller docs for naming/placement details. (documentation.concretecms.org)

If you need more flexible segments (multiple optional parts) you can register a route that captures “the rest” and parse it in PHP. Example pattern (from common c5 examples):

Route::register('/usmarriage{optparams}','Application\Controller\SinglePage\Usmarriage::view')
    ->addRequirements(['optparams' => '.*'])
    ->addDefaults(['optparams' => '/']);

// inside your controller: $opt = Request::getInstance()->get('optparams');

This is useful for variable-depth URLs; parse optparams into parts to find city/state/zip. (archive.concretecms.org)

.htaccess option (server rewrite): you can rewrite anything under /usmarriage/* to pass a location GET var, e.g.

RewriteEngine On
RewriteBase /usmarriage/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /usmarriage/index.php?location=$1 [L,QSA]

Warning: concrete5 already uses front‑controller rewrites — this can create loops or conflicts. Test on a staging server and prefer the CMS routing approach when possible. See Apache mod_rewrite notes. (httpd.apache.org)

Mapping and data flow tips: normalize the path token, try Place Autocomplete / Places API for ambiguous inputs, then geocode to lat/lng (Google Geocoding API or an OSM/Nominatim fallback). Cache geocode results and pre‑store event coordinates so searches run as spatial DB queries (bounding box or Haversine). For large result sets use marker clustering or lazy map loading. See Google Geocoding docs and Nominatim for open alternatives. (developers.google.com)

Notes: this ties back to ’s examples and to ’s .htaccess idea — both approaches work, but the controller/route approaches integrate better with concrete5 and are easier to secure and maintain.

Recommended Answers

All 2 Replies

main url is demonetprojects.com/usmarriage/

google htaccess(linux) url redirect

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.