Answer the question
In order to leave comments, you need to log in
Fix .htaccess to not download index.php (in Yii2)?
Good day!
There was a task to make a temporary redirect from the sitename .ru domain to the ru subdomain using htaccess. sitename.com for all but some of the pages (which start with /news ). Made it a trace. way:
RewriteEngine On
AddDefaultCharset UTF-8
php_value upload_max_filesize 20M
php_value post_max_size 25M
php_value memory_limit 256M
RewriteCond %{REQUEST_URI} !^/news.*$
RewriteRule (.*) http://ru.sitename.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L]
<Directory /path/to/web/dir/www/sitename.ru/web>
Options +ExecCGI
php_admin_value open_basedir "/path/to/web/dir:.:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_flag engine on
</Directory>
<VirtualHost 1.11.11.111:81>
ServerName sitename.ru
DocumentRoot /path/to/web/dir/www/sitename.ru/web
SuexecUserGroup admin admin
CustomLog /path/to/httpd-logs/sitename.ru.access.log combined
ErrorLog /path/to/httpd-logs/sitename.ru.error.log
ServerAlias www.sitename.ru
ServerAdmin [email protected]
ScriptAlias /cgi-bin/ /path/to/web/dir/www/sitename.ru/web/cgi-bin/
php_admin_value open_basedir "/path/to/web/dir:.:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]"
php_admin_value upload_tmp_dir "/path/to/web/dir/mod-tmp"
php_admin_value session.save_path "/path/to/web/dir/mod-tmp"
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
AddHandler php5-script .php
</VirtualHost>
AddHandler php5-script .php
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question