【发布时间】:2019-04-24 01:58:38
【问题描述】:
这是我的 htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [L]
RequestHeader set X-Prerender-Token "**************"
<IfModule mod_rewrite.c>
<IfModule mod_proxy_http.c>
RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator [NC,OR]
RewriteCond %{QUERY_STRING} _escaped_fragment_
# Proxy the request
RewriteRule ^(.*)$ http://service.prerender.io/http://%{HTTP_HOST}$1 [P,L]
RewriteRule ^ /index.html
</IfModule>
</IfModule>
我已经在 Angularjs 中完成了这些-
<head>
<meta name="fragment" content="!">
</head>
$locationProvider.html5Mode(true);
我的网址看起来像-
https://www.{Hostname}/{folder-name}/ (BaseURl)
当我打开下面的 url 时,它会将我重定向到 404
https://www.{Hostname}/{folder-name}/category/category-name
谁能帮我解决这个 htaccess 问题?
【问题讨论】:
标签: apache .htaccess prerender