Comments (15)
How the application was configured? With the virtual host or the .htaccess
file?
from yii2-advanced-one-domain-config.
Thanks for responding. I have made changes to both virtual host
(httpd-vhosts.conf) and .htaccess files.
On Mon, Aug 31, 2015 at 3:21 AM, Oleg Belostotskiy <[email protected]
wrote:
How the application was configured? With the virtual host or the .htaccess
file?—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from yii2-advanced-one-domain-config.
No, it's wrong. You should use one of two ways. Try to remove the .htaccess
file.
from yii2-advanced-one-domain-config.
thanks for the help.
It is throwing same error even after removing .htaccess file.
I could see file structure in my browser when i change the
httpd-vhosts.conf to below,
<VirtualHost *:80>
DocumentRoot C:/Apache24/htdocs/example/frontend/web
ServerName www.example.com
On Mon, Aug 31, 2015 at 11:27 AM, Oleg Belostotskiy <
[email protected]> wrote:
No, it's wrong. You should use one of two ways. Try to remove the
.htaccess file.—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from yii2-advanced-one-domain-config.
You have an incorrect value of the DocumentRoot
directive. Change it to C:/Apache24/htdocs/example
and bring back the .htaccess
file.
from yii2-advanced-one-domain-config.
i corrected it and now i am not seeing the error. but it is not taking me
to home page of the webapp ( index.php) instead browser is showing the
file structure of the folder...
Index of /
• assets/
• css/
• favicon.ico
• index-test.php
• index.php
• robots.txt
On Mon, Aug 31, 2015 at 12:23 PM, Oleg Belostotskiy <
[email protected]> wrote:
You have an incorrect value of the DocumentRoot directive. Change it to
C:/Apache24/htdocs/example and bring back the .htaccess file.—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from yii2-advanced-one-domain-config.
Try this:
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot C:/Apache24/htdocs/example
<Directory />
AllowOverride All
</Directory>
</VirtualHost>
Or just use the configuration that does not use .htaccess
.
from yii2-advanced-one-domain-config.
It didn't work.
I removed .htaccess from the document root folder and used below virtual
host config, please correct me if i am doing some thing wrong here,
Virtual Hosts
Required modules: mod_log_config
If you want to maintain multiple domains/hostnames on your
machine you can setup VirtualHost containers for them. Most configurations
use only name-based virtual hosts so the server doesn't need to worry
about
IP addresses. This is indicated by the asterisks in the directives below.
Please see the documentation at
URL:http://httpd.apache.org/docs/2.4/vhosts/
for further details before you try to setup virtual hosts.
You may use the command line option '-S' to verify your virtual host
configuration.
VirtualHost example:
Almost any Apache directive may go into a VirtualHost container.
The first VirtualHost section is used for all requests that do not
match a ServerName or ServerAlias in any block.
<VirtualHost *:80>
DocumentRoot C:/Apache24/htdocs/example
ServerName www.example.com
RewriteEngine on
# the main rewrite rule for the frontend application
RewriteCond %{REQUEST_URI} !^/(backend/web|admin)
RewriteRule !^/frontend/web /frontend/web%{REQUEST_URI} [L]
redirect to the page without a trailing slash (uncomment if necessary)
#RewriteCond %{REQUEST_URI} ^/admin/$
#RewriteRule ^(/admin)/ $1 [L,R=301]
disable the trailing slash redirect
RewriteCond %{REQUEST_URI} ^/admin$
RewriteRule ^/admin /backend/web/index.php [L]
the main rewrite rule for the backend application
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule ^/admin(.*) /backend/web$1 [L]
DocumentRoot C:/Apache24/htdocs/example
Options FollowSymLinks
AllowOverride None
AddDefaultCharset utf-8
<Directory C:/Apache24/htdocs/example/frontend/web>
RewriteEngine on
# if a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . index.php
Order Allow,Deny
Allow from all
</Directory>
<Directory C:/Apache24/htdocs/example/backend/web>
RewriteEngine on
# if a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . index.php
Order Allow,Deny
Allow from all
</Directory>
<FilesMatch \.(htaccess|htpasswd|svn|git)>
Deny from all
Satisfy All
</FilesMatch>
On Mon, Aug 31, 2015 at 1:32 PM, Oleg Belostotskiy <[email protected]
wrote:
Try this:
<VirtualHost *:80>
ServerName www.example.comDocumentRoot C:/Apache24/htdocs/example <Directory /> AllowOverride All </Directory>
Or just use the configuration
https://github.com/mickgeek/yii2-advanced-one-domain-config/blob/master/vhosts/apache.conf
that does not use .htaccess.—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from yii2-advanced-one-domain-config.
I haven't any problems with your configuration. You have the wrong web server settings, I think. Not enough information to understand the reason.
from yii2-advanced-one-domain-config.
please find my server settings that i changed for this website setup.
please let me know if you need any more information. thanks for the help.
File Name : httpd.conf
ServerName 127.0.0.1:80
DocumentRoot: The directory out of which you will serve your
documents. By default, all requests are taken from this directory, but
symbolic links and aliases may be used to point to other locations.
DocumentRoot "c:/Apache24/htdocs/example"
<Directory "c:/Apache24/htdocs/example">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
MultiViews
#
# Note that "MultiViews" must be named explicitly --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess
files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
File name : hosts
127.0.0.1 example.com
On Mon, Aug 31, 2015 at 2:26 PM, Oleg Belostotskiy <[email protected]
wrote:
I haven't any problems with your configuration. You have the wrong web
server settings, I think. Not enough information to understand the reason.—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from yii2-advanced-one-domain-config.
Hmm, but you don't forget to restart Apache after making changes in the vhost file?
from yii2-advanced-one-domain-config.
I restarted apache after chaning vhost file.
On Mon, Aug 31, 2015 at 3:01 PM, Oleg Belostotskiy <[email protected]
wrote:
Hmm, but you don't forget to restart Apache after making changes in the
vhost file?—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from yii2-advanced-one-domain-config.
Okay, try to change the AllowOverride
directive to All
in the Apache config, use the .htaccess
file, and restart again.
from yii2-advanced-one-domain-config.
It didn't work.
On Mon, Aug 31, 2015 at 5:21 PM, Oleg Belostotskiy <[email protected]
wrote:
Okay, try to change the AllowOverride directive to All in the Apache
config and restart again.—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from yii2-advanced-one-domain-config.
I recommend you return to the default configuration and create the necessary virtual host, according to the documentation. Without any duplicating code! If I understand, now you have two virtual hosts of the one server (in the included httpd-vhosts.conf
file and httpd.conf
). Perhaps that's the problem.
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
- 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.