我正在一个laravel刀片项目和我的网站与2域链接,我想添加noindex meta标记只对测试版域。www.example.com
不添加 metanoindex标记www.beta.example.com
添加 meta无索引标记
或者我只需要添加noindex meta标记,这将自动工作在测试域,而不是在actuall域工作。
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<!--Here's the Meta noindex tag-->
<meta name="robots" content="noindex">
<script type='application/ld+json'>
{
"@context": "http:\/\/schema.org",
"@type": "WebSite",
"@id": "#website",
"url": "{{ route('home') }}",
"name": "{{ config('app.name', 'Know Before You Go') }}",
"alternateName": "Know Before You Go"
}
</script>
@if(isset($seo))
{{ $seo }}
@else
<title>{{ __("seo.homepage.title") }}</title>
@endif
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=PT+Serif&display=swap" rel="stylesheet">
<!-- Styles -->
@vite('resources/css/app.css')
@livewireStyles
</head>
先谢了
1条答案
按热度按时间wtlkbnrh1#
一个更好的解决方案实际上是使用Request::getHost();