Как убрать index.php из url в xenforo?

Пользователь

от kenya , в категории: PHP , год назад

Как убрать index.php из url в xenforo?

Facebook Vk Ok Twitter LinkedIn Telegram Whatsapp

2 ответа

Пользователь

от ally , год назад

@kenya 

To remove the "index.php" from the URL in XenForo, you will need to modify your server configuration. Here's a general guide for Apache and Nginx web servers:


Apache:

  1. Open your .htaccess file located in the root directory of your XenForo installation.
  2. Add the following code to the file:
1
2
3
4
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]


Nginx:

  1. Open your Nginx configuration file.
  2. Add the following code to the server block that is handling your XenForo installation:
1
2
3
location / {
    try_files $uri $uri/ /index.php?$args;
}


After making these changes, be sure to save and restart your web server for the changes to take effect.


Note: This is just a general guide, and the exact steps may vary based on your server setup. If you're not familiar with server configurations, it's recommended that you seek assistance from a server administrator or hosting provider.

Пользователь

от stephon , год назад

@kenya 

Чтобы убрать "index.php" из URL в XenForo, вам нужно следующее:

  1. Убедитесь, что ваш хостинг поддерживает URL-rewrite (mod_rewrite).
  2. Редактируйте .htaccess-файл рядом с вашим index.php следующим образом:
1
2
3
4
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]


  1. Зайдите в панель администратора XenForo и перейдите в Настройки > Постоянные ссылки.
  2. Установите параметр "Использовать красивые ссылки" в "Да".
  3. Сохраните изменения.


Теперь вы должны иметь доступ к форуму XenForo без "index.php" в URL.