У меня есть сайт angularJS, а файл .htaccess настроен для перенаправления всего трафика с mysite.se/* на mysite.se/index.html..htaccess: разрешить конкретный URL-адрес
Он также настроен с помощью prerender.io, чтобы поисковые системы могли получить доступ к сайту.
Вопрос: Я хочу добавить блог в blog.mysite.se, и проблема в том, что он будет перенаправлен на mysite.se/index.html. Что мне нужно добавить в файл .htaccess, чтобы через blog.mysite.se?
Благодаря
RewriteEngine On
RewriteCond %{HTTP_HOST} ^MYSITE\.se$ [NC]
RewriteRule ^.*$ http://www.MYSITE.se%{REQUEST_URI} [R=301,L]
# If requested resource exists as a file or directory
# (REQUEST_FILENAME is only relative in virtualhost context, so not usable)
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
# Go to it as is
RewriteRule^- [L]
# If non existent
# If path ends with/and is not just a single /, redirect to without the trailing/
RewriteCond %{REQUEST_URI} ^.*/$
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^(.*)/$ $1 [R,QSA,L]
# Handle Prerender.io
RequestHeader set X-Prerender-Token "kEJ0CC1gMnj6V0J4u8xu"
RewriteCond %{HTTP_USER_AGENT} baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest [NC,OR]
RewriteCond %{QUERY_STRING} _escaped_fragment_
# Proxy the request
RewriteRule ^(.*)$ http://service.prerender.io/http://%{HTTP_HOST}$1 [P,L]
# If non existent
# Accept everything on index.html
RewriteRule^/index.html