@newaitix

Как правильно составить htaccess?

Этот htaccess лежит в корне сайта.
RewriteEngine On
php_value session.name "invariable"
php_value session.save_path "psid/"
php_value auto_prepend_file "/prepend.php"
DirectoryIndex resource/html/newpage.html
RewriteRule ^js/(.*)$ /resource/js/$1
RewriteRule ^css/(.*)$ /resource/css/$1
RewriteRule ^templater/(.*)$ /resource/html/templater/$1
RewriteRule ^/img/favicon.ico$ /resource/img/favicon.ico
AddType text/html .tpl
<IfModule mod_expires.c>
	ExpiresActive on
	ExpiresByType image/jpg "access plus 1 year"
	ExpiresByType image/png "access plus 1 year"
	ExpiresByType application/pdf "access plus 1 year"
	ExpiresByType text/x-javascript "access plus 1 year"
	ExpiresByType application/x-shockwave-flash "access plus 1 year"
	ExpiresByType image/x-icon "access plus 1 year"
	ExpiresDefault "access plus 1 year"
	ExpiresByType text/html "access plus 1 year"
	ExpiresByType audio/ogg "access plus 1 year"
	ExpiresByType image/gif "access plus 1 year"
	ExpiresByType image/jpeg "access plus 1 year"
	ExpiresByType video/mp4 "access plus 1 year"
	ExpiresByType video/ogg "access plus 1 year"
	ExpiresByType video/webm "access plus 1 year"
	ExpiresByType application/javascript "access plus 1 year"
	ExpiresByType text/css "access plus 1 year"
</IfModule>


Мне нужно при запросе /?auth=fb или /?auth=vk пользователь получал редирект.
Файл prepend.php
if($_GET['auth']=='fb'){
	header('Location:https://fb.com/');
	exit;
}
if($_GET['auth']=='go'){
	header('Location:https://go.com/');
	exit;
}

При переходе на /?auth=... пользователь получает newpage.html
Почему ? И как сделать так чтоб его запрос проходил сперва через prepend.php
  • Вопрос задан
  • 161 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы