简体   繁体   English

使用.htaccess从网址中删除关键字

[英]Remove the keyword from url using .htaccess

How to remove "specific" keyword from url...keyword may come on 2,3rd or 4th position after ".com" 如何从网址中删除“特定”关键字...关键字可能在“ .com”之后的第2、3或第4位

For example: 例如:

I want to remove keyword "mobile" from below urls 我想从网址下方删除关键字“移动”

http://www.mysites.com:8083/robert/projects/google/mobile/india/en/ http://www.mysites.com:8083/projects/google/mobile/india/en/ http://www.mysites.com/mobile/india/en/

Try something like this in your .htaccess file 在您的.htaccess文件中尝试类似的操作

RewriteEngine On
RewriteRule ^(.*)/mobile/(.*)$ $1/$2 [R=301,L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM