A
A
AllReady2018-07-15 17:17:10
Yii
AllReady, 2018-07-15 17:17:10

How to setup 2 versions of http/https site on yii1 + htaccess?

Good afternoon. The site is hosted by timeweb. There was a task: there is a site with https. Redirects from http to https or vice versa have not yet been set up, there are reasons for that: seo. You need to split the site into 2 versions.
1) with https
2) with http I
created a dev folder in the public_html folder where I placed a copy of the site with some SEO changes
In the htaccess settings (at the root - public_html) I wrote:

<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteBase /
RewriteCond %{HTTP:X-HTTPS} 1
RewriteRule ^(.*)$ /dev/$1 [QSA,L]
</IfModule>

That is, if the protocol is https - send requests to the dev folder. I switch to the c https version - everything works. But if I open an internal page, for example contacts, the main page opens. Be sure to add the /dev/ prefix. That is, https://site.ru/dev/contacts works, and https://site.ru/contacts opens the main https://site.ru/. What rules should be specified in the htaccess of a new project located in the dev folder? I can't solve this problem in any way. Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question