php - Yii2: Subdomain in subdirs redirects to subdir -


i wan't have 2 complete yii2 frameworks running: 1 on main website , 1 in subdomain (for testing). example on www.example.com & staging.example.com.

everything seems working fine staging keeps redirecting me subfolder (to staging.example.com/staging) , don't want that! want url staging.example.com

the folder setup is:

  • /var/framework-live/ -> yii2 framework
  • /var/framework-staging/ -> yii2 staging framework
  • /var/www/ -> web folder
  • /var/www/staging/ -> staging web folder

i have in htdocs/.htaccess:

options +followsymlinks -multiviews  rewriteengine on  rewritebase /  # staging rewritecond %{http_host} ^staging.example.com$ [nc] rewriterule ^((?!staging).*)$ /staging/$1 [nc,l]  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php 

and in htdocs/staging/.htaccess:

options +followsymlinks  rewriteengine on  # if directory or file exists, use directly rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d # otherwise forward index.php rewriterule . index.php 

does have idea doing wrong?

you can access virtual host config (on shared hosting)? create 2 separate folders:

/htdocs/framework-1/web/ /htdocs/framework-2/web/ 

and map domains these folders using virtual hosts.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -