cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4.4 in eine Subdirectory installieren

SOLVED

Magento 2.4.4 in eine Subdirectory installieren

Hallo Leute,

 

ich will Magento 2.4.4 in einen Subdirectory installieren, dass ich die Instanz dann über www.example.com/shop erreichen kann. Leider funktioniert das nicht.

 

Es handelt sich um einen Server mit ubuntu 18.04 mit apache2 und mariaDB

 

Die apache conf zeigt auf /var/www/live

Magento ist hier im Ordner installiert /var/www/live/shop

 

Wenn ich die base URL auf www.example.com/shop/pub ändere wie hier beschrieben

 

https://community.magento.com/t5/Installing-Magento-2-x/How-to-Install-Magento-2-4-2-version-in-a-Su...

 

ist die Seite erreichbar, aber ich will das sie unter www.example.com/shop erreichbar ist Smiley Wink

 

Könnt ihr mir vielleicht hier weiterhelfen?

 

Danke! Lg mandi

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.4.4 in eine Subdirectory installieren

Hi @mandipixel4dbd ,

 

Please follow below steps to make it work without /pub in base url.

 

1) copy index.php and .htaccess files from /pub to your magento root folder (into shop folder)

 

2) Find the below line in index.php (from the shop folder)

require _DIR_ . '/../app/bootstrap.php';

and replace it with

require _DIR_ . '/app/bootstrap.php';

 

3) Go to magento 2 database which you recently created and find the table core_config_data

In this table you need to insert/update below rows

Path => Value

a) web/secure/base_static_url => https://www.example.com/shop/pub/static/

b) web/unsecure/base_static_url => https://www.example.com/shop/pub/static/

c) web/secure/base_media_url => https://www.example.com/shop/pub/media/

d) web/unsecure/base_media_url => https://www.example.com/shop/pub/media/

 

Problem solved? Click Accept as Solution!

 

Hope it helps!

Thanks

Ankit Jasani

View solution in original post

1 REPLY 1

Re: Magento 2.4.4 in eine Subdirectory installieren

Hi @mandipixel4dbd ,

 

Please follow below steps to make it work without /pub in base url.

 

1) copy index.php and .htaccess files from /pub to your magento root folder (into shop folder)

 

2) Find the below line in index.php (from the shop folder)

require _DIR_ . '/../app/bootstrap.php';

and replace it with

require _DIR_ . '/app/bootstrap.php';

 

3) Go to magento 2 database which you recently created and find the table core_config_data

In this table you need to insert/update below rows

Path => Value

a) web/secure/base_static_url => https://www.example.com/shop/pub/static/

b) web/unsecure/base_static_url => https://www.example.com/shop/pub/static/

c) web/secure/base_media_url => https://www.example.com/shop/pub/media/

d) web/unsecure/base_media_url => https://www.example.com/shop/pub/media/

 

Problem solved? Click Accept as Solution!

 

Hope it helps!

Thanks

Ankit Jasani