搜索引擎友好的URL和重定向 [英] seo friendly url and redirect

查看:168
本文介绍了搜索引擎友好的URL和重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我终于找到了一种方法,从我的网址删除GET参数 我有URL如 /s.com/file.php?name=somthing

I finally found a way to remove get parameters from my urls i had url like /s.com/file.php?name=somthing

本codeI他们改变为 s.com/file/somthing

with this code i changed them to s.com/file/somthing

选项+了FollowSymLinks  RewriteEngine叙述在

Options +FollowSymLinks RewriteEngine On

重写规则^文件/(.*?)$ http://s.com/file.php ?NAME = $ 1

RewriteRule ^file/(.*?)$ http://s.com/file.php?name=$1

到目前为止,一切都很好

so far everything is ok

在我的本地主机当我点击像一个网址 s.com/file/somthing 它会完全的网址

in my local host when i click on a url like s.com/file/somthing it goes exactly to the url

但在我的服务器重定向到旧的URL,并显示旧的URL

but in my server it redirects to old url and shows old url

我不想显示我的旧网址

有人可以帮忙吗?

推荐答案

HTTP重定向总是外部=>显示在浏览器中。尝试:

http redirects are always external => visible in the browser. Try that:

RewriteRule ^file/(.*?)$ /file.php?name=$1

这篇关于搜索引擎友好的URL和重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆