Задать вопрос
@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
  • Вопрос задан
  • 163 просмотра
Подписаться 1 Простой Комментировать
Помогут разобраться в теме Все курсы
  • Skillbox
    Веб-разработчик на PHP
    9 месяцев
    Далее
  • Хекслет
    PHP-разработчик
    10 месяцев
    Далее
  • Нетология
    Веб-разработчик с нуля: профессия с выбором специализации
    14 месяцев
    Далее
Пригласить эксперта
Ваш ответ на вопрос

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

Похожие вопросы
FoodSoul Калининград
от 180 000 до 250 000 ₽
IT-Spirit Москва
от 230 000 до 320 000 ₽
от 200 000 до 290 000 ₽