Git Product home page Git Product logo

Comments (1)

mickgeek avatar mickgeek commented on May 26, 2024 1

Hi.

Your virtual host configuration should be like follow that:

<VirtualHost *:80>
    ServerName 0.0.0.0
    DocumentRoot /home/app

    <Directory />
        DirectoryIndex index.html

        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Create and edit the application files. The /home/app/yii2-app-advanced/.htaccess file:

RewriteEngine on

RewriteCond %{REQUEST_URI} ^
RewriteRule ^ frontend/web%{REQUEST_URI}
RewriteRule /admin backend/web%{REQUEST_URI}

The /home/app/yii2-app-advanced/frontend/web/.htaccess and /home/app/yii2-app-advanced/backend/web/.htaccess files:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

The /home/app/yii2-app-advanced/frontend/config/main.php file:

'homeUrl' => '/yii2-app-advanced',
'components' => [
    'request' => [
        'baseUrl' => '/yii2-app-advanced',
    ],
    'assetManager' => [
        'baseUrl' => '/yii2-app-advanced/frontend/web/assets',
    ],
...

The /home/app/yii2-app-advanced/backend/config/main.php file:

'homeUrl' => '/yii2-app-advanced/admin',
'components' => [
    'request' => [
        'baseUrl' => '/yii2-app-advanced/admin',
    ],
    'assetManager' => [
        'baseUrl' => '/yii2-app-advanced/backend/web/assets',
    ],
...

Also modify the /home/app/yii2-app-advanced/frontend/assets/AppAsset.php and /home/app/yii2-app-advanced/backend/assets/AppAsset.php files: the $baseUrl variable should be /yii2-app-advanced/frontend/web and /yii2-app-advanced/backend/web respectively.

The server version: Apache/2.4.53. Sorry for the late answer.

from yii2-advanced-one-domain-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.