跳转到主要内容
你行网

Main navigation

  • 首页
  • Drupal
  • 编程与开发
  • 数据库
  • 操作系统与应用
  • 服务器与运维
  • 社区
User account menu
  • 登录

面包屑

  1. 首页

drupal Index.php 的永久解决方法

由 hrs, 27 五月, 2022

1. 首先在 robots.txt 文件中添加“ Disallow: /index.php/* ”。(这将有助于阻止 Google 在 URL 中使用 index.php 对页面进行索引。)

2. 然后在 .htaccess 文件的顶部,为您的特定站点逐个目录提供永久重定向目录。例如:

<IfModule mod_rewrite.c>
  RewriteEngine on 

  RewriteRule ^index.php/categories$ /categories [R=301,L]
  RewriteRule ^index.php/categories/(.*) /categories/$1 [R=301,L] 

</IfModule>

对我来说,它已经到了谷歌停止索引我的大部分网站的地步,因为它发现了所有这些重复的 URL(一个带有 index.php,另一个没有)。

现在我的 index.php 问题消失了,并且(慢慢地)Google 正在摆脱 index.php URL 的搜索索引。

  • 登录或注册以发表评论
内容类型分类
操作系统与运用
文章归类
drupal

文章标签

  • Drupal

评论

文章标签

Excel
CSS
ubuntu
php
vim
五笔
VPN
Linux
command
HTML
drupal 8
drupal 7
centos
composer
Mysql
模块(module)
drush
Drupal
JavaSrcipt
apache
英语
drupal 9
nerdtree
network
果树种植
surround
drupal10
SEO
主题(theme)
二进制
更多

相关文章

  • 因权限问题导致drupal cms 无法正常安装,那么该如何解决这个问题
  • Drupal 11 主题制作教程
  • 在 Drupal 中权重(Weight)是怎样排序的
  • 解决 Drupal 主题缺失问题
  • Drupal 11.1:告别 Body 字段,迎接全新的 Hook 系统
  • 网络文章如何规划字段设计
  • 网站标签分类设计与优化指南
  • linux-firmware 是什么,有哪些作用?
  • journalctl 的使用和简介
  • Drupal 11:拥抱未来,构建更强大的数字体验
RSS源

友情链接 网站地图 版权信息 联系我们 网址导航 社区

Copyright © 2019 - 2021 你行网 版权所有  粤ICP备19072650号