Comments (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)
- Add configuration for IIS HOT 1
- Apache 2.4 version HOT 1
- nginx: url alias with same name as folder name not working
- All links of the site always loads the home page. HOT 3
- Why don't use Alias in Apache? HOT 4
- Nginx config HOT 2
- subdirectory url is not removing HOT 1
- Combine redirect https rule HOT 10
- adding a new URI HOT 2
- Used your settings htaccess etc but not working :( HOT 1
- If you have 500 internal error after change .htaccess
- Trying to get in touch regarding a security issue HOT 9
- Kk
- Internal server error 500 after making changes HOT 15
- how to configure if Yii2 advance template is installed under sub directory of Document root? HOT 13
- phpMyAdmin HOT 1
- add one line in /etc/hosts file for work all... HOT 1
- Options not allowed here: .htaccess HOT 3
- No longer fully working since nginx 1.8.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-advanced-one-domain-config.