我有代码点火器.htaccess文件,如
<ifModule mod_rewrite.c>
RewriteEngine on
# allow social media crawlers to work by redirecting them to a server-rendered static version on the page
RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet)
RewriteRule eventApp/(\d*)$ [P]
# Required to allow direct-linking of pages so they can be processed by Angular
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /eventApp/index.html [NC,L]
</ifModule>但我想从拉拉上去掉标签。
发布于 2016-10-22 09:00:50
要从URL片段中删除散列,只需设置角以不添加它,不需要修改.htaccess文件。因此,这个答案为提出的问题提出了一个更明确的解决办法。
在你的角基模块中,通常是在你定义路线的地方。
angular.module('app', [])
.config([
'$routeProvider',
'$locationProvider',
function($routeProvider, $locationProvider) {
// Hashtags no longer appear with this
$locationProvider.html5Mode(true);
// Route definitions below
}]);您还需要在base视图中设置header元素。这是用角来确定它在构造URL时应该使用的路径。这个例子将使用根。
<!doctype html>
<head>
<title>Laravel</title>
<base href="/" />
</head>https://stackoverflow.com/questions/40189153
复制相似问题