Support Friendly Urls Error , please help me

newmoon

Registered
1770220355437.png

trying to use friendly url and i get this errors , it gives 404 error after click on any node
please any professional and helper
i would be really greatful for this , thank you
 

ZariotaLemu

Registered
Try it. I haven't tested it.

When XenForo is running on
Nginx, 404 errors with "Friendly URLs" occur because Nginx does not support .htaccess files. You must manually add rewrite rules to your Nginx configuration file (typically located in /etc/nginx/sites-available/ or /usr/local/nginx/conf/).

How to Fix the Error:
Edit your Nginx Config:
Locate the location / block for your domain and update it with the following:
Code:
location / {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$uri&$args;
}

Note: If XenForo is in a subfolder like /community/, change it to location /community/ and /community/index.php.

Protect Sensitive Directories:
Add these security rules to prevent direct access to core files:
Code:
location ^~ /install/data/ { internal; }
location ^~ /install/templates/ { internal; }
location ^~ /internal_data/ { internal; }
location ^~ /library/ { internal; }
location ^~ /src/ { internal; }

Test and Reload Nginx:
Verify your syntax and apply the changes:
Code:
nginx -t
service nginx reload

Enable in XenForo Admin Panel:
Navigate to the XenForo Manual Section on SEO and ensure "Use full friendly URLs" is checked under Setup > Options > Search engine optimization (SEO).

Common Issues:
  • Plesk/cPanel: If using a control panel, enter these rules in the "Additional nginx directives" section instead of editing files directly.
  • PHP-FPM: Ensure your .php block doesn't use try_files $uri =404; as it can conflict with the rewrites; use try_files $uri /index.php?$uri&$args; instead.

Would you like help with a specific configuration for a subdirectory, or help finding your Nginx log files to debug further?
  • Identify installation path
  • Check PHP-FPM socket settings
  • Review Plesk/cPanel specific steps

Good Luck.
 
Back
Top Bottom