2
取下laravel角度包括hashtag我有一个像使用的.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>
笨.htaccess文件,但我想从laravel删除#标签。
是否没有其他方式指定基地Angular?使用该标签会破坏正常的片段链接,例如''在URL路径'/ foo /'的页面不会进入'/ foo /#bar'。 – Walf
是的,这是正确的,但如果我可以刷新我的网页,它会显示错误,如页面找不到laravel。所以我认为我们需要为它设置.htaccess。所以它在CI中工作就像上面的规则一样,我不设置它laravel。如果您知道,请告诉我们。 – Kamlesh
你可以在laravel中捕捉路由,你不需要'.htaccess'修改。 'Route :: any('{path?}',function(){return view(“index”);}) - > where(“path”,“。+”);'注意结尾的位置这将匹配所有未定义的路由并返回角度应用程序。 –