Navigation App URL field keeps reverting custom module link / causing "Page Not Found" loop
Hi everyone,
I am trying to link a menu item in my Site Sidebar Navigation to the main landing page of a custom Personals module.
The live, working SEO path of the page on my site is simply: personal-home
However, I am running into a major issue in the Navigation App:
- When I open the Navigation settings for this item and enter the path page/personal-home, the app aggressively rewrites and saves the field as page.php?i=personal-home
- When clicking the link on the live site, this rewritten path results in a "Page Not Found" error and redirects back to the account dashboard.
- If I try to use the Onclick field with a javascript redirect to force it to the personal-home path, the system ignores it and still prioritizes the broken reverted database path.
The page exists under Studio > Pages > Modules as "Personals Home", and all the blocks are active and visible to anyone.
How can I force the Navigation App to respect the correct path for this module page without it constantly reverting to a broken page.php link? Is there a specific routing key or module setting I need to adjust to fix this redirect loop?
Thanks in advance!
-
-
·
LeonidS
- ·
Hello @AdMaster22 !
The page.php?i=smth solution provides the universal processing of the links on the site (with enabled or disabled permalinks mode). But in your case, it seems smth isn't good with the Rewrite module of your web-server. Could you please provide me your Control Panel and UNA access via Messenger?
-
·
LeonidS
-
- · Ryan
-
·
In reply to LeonidS
- ·
Thanks for the update. It makes sense that the server's Rewrite module is struggling with the permalinks.
Since I prefer not to hand over full Control Panel credentials, could you please tell me exactly what rules or directives need to be added to my .htaccess file (or Nginx configuration) to make the
page.php?i=rewrite rule process correctly for custom module pages? I can update the file directly on my end. -
-
·
LeonidS
-
·
In reply to Ryan
- ·
The default .htaccess file has the following lines:
Options -MultiViews -Indexes <IfModule mod_php5.c> php_flag allow_url_include Off php_flag register_globals Off </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^m/(.*)$ modules/index.php?r=$1 [QSA,L] RewriteRule ^page/(.*)$ page.php?i=$1 [QSA,L] RewriteRule ^s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+) storage.php?o=$1&f=$2 [QSA,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule .+ - [L] RewriteRule ^(.+)$ r.php?_q=$1 [QSA,L] </IfModule> AddType image/svg+xml svgThe best ways for the Nginx were described here:
-
·
LeonidS
-
- · Ryan
-
·
In reply to LeonidS
- ·
Thank you for replying so quickly. My .htaccess reflected what you posted. Here's what was happening:
The Site Sidebar item was automatically overriding the URL to an incorrect property-author path.
I was experiencing a routing issue with the Personals module navigation item within the
Site Sidebarmenu (using the Artificer theme layout).Even when manually adjusting the menu item link or system fields in Studio > Navigation, saving the item causes the system to aggressively force a rewrite of the link macro. Instead of generating the expected clean friendly path layout for the module's home (
/page/personal-home), the frontend navigation item renders the link dynamically as a path pointing toproperty-author?owner=1This triggers a hard 404 error for end-users, as it forces the Personals navigation block to map to a completely different module's author profile hook (
property-author), rather than parsing the clean page parameter.Temporary Server-Side Workaround Used: To get the site operational, I had to manually intercept this specific rewrite error at the Apache server level inside
.htaccessright before the generic page routing rule:Apache
RewriteRule ^property-author$ page.php?i=personal-home [QSA,L]
Steps to Reproduce:
- Install and initialize the Personals module alongside standard system profile navigation.
- Observe the generated link for the "Personals" block inside the main Site Sidebar menu.
- The core layout automatically appends/reverts the path to the property author query string upon menu compilation/cache building, entirely bypassing the underlying page setting (
page.php?i=personal-home).
Could you please verify why the navigation system is mapping the Personals home menu item macro to the property module template/author handler? It appears to be a database compilation or system name conflict within the navigation item building logic.
Final Output:
# 1. Specific Routes First RewriteRule ^m/(.*)$ modules/index.php?r=$1 [QSA,L] RewriteRule ^property-author$ page.php?i=personal-home [QSA,L] RewriteRule ^page/(.*)$ page.php?i=$1 [QSA,L] RewriteRule ^s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+) storage.php?o=$1&f=$2 [QSA,L]