0

my current path `

http://magento2/index.php/router/controller/action

preface

  • this address (index.php) is added to the line after the redirect, but there is no error
  • I didn't do anything to make it happen. In an instant, it just happened and I don't know how to remove it.
  • I already had this once. it was solved by reinstalling magento2
  • I didn't change anything in nginx config
  • .htaccess in /var/www/magento2/app/
    RewriteEngine On
RewriteBase /
<IfVersion < 2.4>
    order allow,deny
    deny from all
</IfVersion>
<IfVersion >= 2.4>
    Require all denied
</IfVersion>
  • .htaccess in /var/www/magento2/
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php
  • NGINX config /etc/nginx/config-enable/file:
upstream fastcgi_backend {
         server unix:/var/run/php/php7.4-fpm.sock;
     }

     server {
         listen 80;
         listen [::]:80;

         server_name  magento2 magento2.com www.magento2.com;
         index  index.php;

         set $MAGE_ROOT /var/www/magento2;
         set $MAGE_MODE developer;

         access_log /var/log/nginx/magento2.com-access.log;
         error_log /var/log/nginx/magento2.com-error.log;

         include /var/www/magento2/nginx.conf.sample;
     }
1
  • please let me know if you need any more information! thanks a lot!
    – esca7a
    Commented Jun 2, 2022 at 10:59

2 Answers 2

0

Please refer to this article.

https://www.milople.com/blogs/remove-index-php-from-url-magento/

0

i do it that - it helped me to reinstall admin data

bin/magento setup:install
--base-url=http://magento2/
--db-host=localhost
--db-name=magento2
--db-user=esca7a
--db-password=5800
--admin-firstname=admin
--admin-lastname=admin
[email protected]
--admin-user=admin
--admin-password=admin123
--language=en_US
--currency=USD
--timezone=Europe/Minsk
--use-rewrites=1
--search-engine=elasticsearch7
--elasticsearch-port=9200
--elasticsearch-timeout=30

I hope this helps you as it helped me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.