Comments (13)
What exactly doesn't work? Give more information and show the directory hierarchy.
from yii2-advanced-one-domain-config.
Directory structure is set as below image, highlighted part is my document root, You can see two more directory under doc root and then Yii2 setup. I have made all changes which is mentioned in you repository.
Url : http://192.168.0.2:36/project/yii-advance/ showing me 404 see below image
Url : http://192.168.0.2:36/project/yii-advance/admin showing me 404 see below image
Let me know if any further details required
from yii2-advanced-one-domain-config.
If I add below line in root htaccess file then it is showing 500 internal server error.
RewtiteBase /project/yii-advance/
from yii2-advanced-one-domain-config.
The RewtiteBase
directive doesn't exist. What you have in the log file of the web server when there is 404?
from yii2-advanced-one-domain-config.
sorry it was typo. RewriteBase /project/yii-advance/
also gives me 404 and nothing being logged in my error log file. anything I need to do to enable logging?
Here is my virtual host for your information:
# Yii2 Sub Dir
Listen *:36
<Directory "G:\study\yii-subdir">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:36>
ServerAdmin [email protected]
DirectoryIndex index.php index.html
DocumentRoot "G:\study\yii-subdir"
ServerName dummy-host2.example.com
ErrorLog "logs/subdir-error.log"
#CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
from yii2-advanced-one-domain-config.
Try the following configuration by changing the parameters on your own.
Virtual host:
<VirtualHost *:80>
ServerName yii2.loc
DocumentRoot "/media/sf_www/deb7apache/docs/yii2.loc"
<Directory "/">
DirectoryIndex index.html index.php
AllowOverride All
</Directory>
</VirtualHost>
yii2.loc/demo/advanced/.htaccess:
Options FollowSymLinks
AddDefaultCharset utf-8
<IfModule mod_rewrite.c>
RewriteEngine On
# the main rewrite rule for the frontend application
RewriteCond %{REQUEST_URI} !^/demo/advanced/(frontend/web|backend/web|admin)
RewriteRule ^(.*) /demo/advanced/frontend/web/$1 [L]
# redirect to the page without a trailing slash (uncomment if necessary)
#RewriteCond %{REQUEST_URI} ^/demo/advanced/admin/$
#RewriteRule ^(admin)/ /demo/advanced/$1 [L,R=301]
# the main rewrite rule for the backend application
RewriteCond %{REQUEST_URI} ^/demo/advanced/admin
RewriteRule ^admin(.*) /demo/advanced/backend/web/$1 [L]
# if a directory or a file of the frontend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/demo/advanced/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . /demo/advanced/frontend/web/index.php [L]
# if a directory or a file of the backend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/demo/advanced/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . /demo/advanced/backend/web/index.php [L]
RewriteCond %{REQUEST_URI} \.(htaccess|htpasswd|svn|git)
RewriteRule \.(htaccess|htpasswd|svn|git) - [F]
</IfModule>
In the frontend configuration file, change the value of the baseUrl
property to /demo/advanced
, in the backend - to /demo/advanced/admin
. And everything else is same as in the manual.
from yii2-advanced-one-domain-config.
Does above changes works at your end?
I am getting below mentioned errors:
( ! ) Warning: require(G:\study\yii-subdir\project\yii-advance\frontend\web/../../common/config/main-local.php): failed to open stream: No such file or directory in G:\study\yii-subdir\project\yii-advance\frontend\web\index.php on line 12
( ! ) Fatal error: require(): Failed opening required 'G:\study\yii-subdir\project\yii-advance\frontend\web/../../common/config/main-local.php' (include_path='.;C:\php\pear') in G:\study\yii-subdir\project\yii-advance\frontend\web\index.php on line 12
Image for reference:
from yii2-advanced-one-domain-config.
Yes, on Debian works fine. Make sure that the application was initialized (details).
from yii2-advanced-one-domain-config.
I have installed using composer so it must be initialized automatically?
from yii2-advanced-one-domain-config.
@mickgeek not sure but I have tried init for my app and it works. Thanks for all the help.
Just thought: Can we have something which works regardless of structure?
from yii2-advanced-one-domain-config.
Installation via Composer (or from the archive file) only copies the data repository. Then you should to prepare the application to run. See the link above.
from yii2-advanced-one-domain-config.
I am glad to help.
Create a configuration that would work regardless of a structure is hardly possible. Sysadmins must deal with fine-tuning the server.
from yii2-advanced-one-domain-config.
If at all possible, I suggest you make your installation match the exact scenario that this project has been configured for so you can at least get it working to start with.
Thereafter you can start tweaking one setting at a time followed by testing.
In other words NOT install under sub-directory of documentroot.
Don't be in a hurry to give up on this nice piece of work by @mickgeek
Adam
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
- Inside subdirectory HOT 1
- Trying to get in touch regarding a security issue HOT 9
- Kk
- Internal server error 500 after making changes HOT 15
- 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.