跳转到主要内容
你行网

Main navigation

  • 首页
  • 文章
  • 教程
  • 视频
  • 下载
  • 社区
  • 网址导航
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 中权重(Weight)是怎样排序的
解决 Drupal 主题缺失问题
Drupal Composer命令及作用总结
drupal 中的解耦菜单
drupal .htaccess 文件的配置解释
drupal启用大文件上传解决方案
如何从基于 Drupal 的 CMS URL Linux 门户中删除 index.php
drupal 基本的目录结构
drupal index.php 的工作流程
在 Drupal 8 中从 URL 中删除 index.php
Drupal 机读名称的命名规范
如何使用Drupal构建网站

文章标签

CSS
Excel
ubuntu
php
五笔
vim
Linux
VPN
command
HTML
drupal 7
centos
composer
Mysql
drupal 8
模块(module)
drush
JavaSrcipt
apache
drupal 9
英语
Drupal
nerdtree
SEO
network
果树种植
surround
drupal10
主题(theme)
phpmyadmin
ssh
二进制
yum
权限
声音
ssl
selinux
HTML5
用户
password
Dreamweaver
flameshot
翻译
颜色
uploadprogress
DDEV
kernel
视图(views)
firewalld
WireGuard
快捷键
gzip
xdebug
错误
邮件验证
ckeditor
电脑基础
简介
mbstring
源地址
C语言
certbot
php扩展
git
apt
httpd
电子秤
压缩解压
表单
breadcrumb
AI
短信验证
superfish
摄影
重定向
diff
网站备份
csharp
tagclouds
java
docker
adsense
版本号
电脑技巧
RSS
simple_adsense
算法
drupal 11
端口
youtube
JavaScript
cookie
badblocks
VUE
计算机基础
网站运营
RFID
gimp
nginx
form
zip
mod_expires 模块
http验证
ip
dns
标签优化
curl
赚钱
重定向,301
netstat
maven
input
字段
npm
哈希值
wps
更多
RSS源

友情链接 网站地图 版权信息 联系我们 & 社交媒体链接

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