草庐IT

.htaccess - htaccess 两个参数 mod-rewrite 问题

我正在尝试设置一个更友好的URL系统,但不幸地失败了。我希望能够像这样传递1或2个GET参数:http://website.com/1234/123456其中1234是第一个参数,123456是第二个参数。在我的尝试中,Apache始终将/1234/视为文件夹和参数。到目前为止,这是我尝试过的:RewriteRule^([^/]*)/([^/]*)$index.php?id=$1&pa=$2[L]和RewriteRule^(.*)/(.*)$index.php?id=$1&pa=$2RewriteRule^(.*)$index.php?id=$1[L] 最佳

php - 由于 mod_rewrite 的重复搜索结果

我有典型的mod_rewrite规则来使url更漂亮RewriteRule^most-viewed$index.php?time=1RewriteRule^most-viewed-week$index.php?time=2但不知何故,谷歌也设法获得了index.php?time=版本,所以现在,在谷歌搜索结果中显示了两个结果,一个带有mod_rewriteurl,一个是“常规”。恐怕这对seo不利,因为这可能被视为“重复内容”。我怎样才能避免“常规”的被编入索引,或者更好的是,让每个人都无法访问它。如果有帮助,我会使用PHP。 最佳答案

mod-rewrite php to html url not indexed

我目前在我的.htaccess文件中使用Rewriterule将我网站上的每个.php页面更改为.html。我也用它来改变搜索结果页面从www.example.com/search_page.php?city=name&state=name&id=1234类似于www.example.com/result-google-friendly-url-1234.html一切正常,但当我进行更改时,谷歌现在只索引我的索引页。我认为这可能与我在同一页面上有2个url而google决定不对其中任何一个建立索引这一事实有关。谷歌网站管理员说有16个页面“未选择”,然后说这可能归因于“规范化”,我不完

.htaccess - mod重写删除分页重复内容

我有重复内容的问题...我的链接是这样的:原创:www.example.ro/men-shoes/复制:www.example.ro/men-shoes/pagina-1/原创www.example.ro/women-shoes/复制:www.example.ro/women-shoes/pagina-1/和其他以/pagina-1/结尾的类似页面我不擅长mod重写..但我试过这段代码RewriteCond%{QUERY_STRING}^pagina-1/$RewriteRule^(.*)$1[L,R=301]没用...我很乐意解决这个问题!谢谢! 最佳答案

apache - mod_rewrite 使用动态数字标识符更改单词

我想做的是重写URL中旧项目模块中的一些词,以便它们看起来适用于当前项目。我开始的URL是:http://WEBSITE.com/stories/topic/view/pet_id/6/topic_id/41我在.htaccess中的内容是:#ChangePetandTopictoStoryandChapterRewriteCondstories/topic/view/pet_id/([A-Za-z0-9-]+)/topic_id/RewriteRulestories/topic/view/pet_id/6/topic_id/.*$stories/chapter/view/story_

mod-rewrite - 为 SEO 重写单页模组

我有一个页面如下。www.mysite.com/about.php我希望将其设置在htaccess文件中,如下所示。www.mysite.com/my-keyword-here请帮帮我。提前致谢。山姆 最佳答案 将此添加到文档根目录中的htaccess文件中:RewriteEngineOnRewriteRule^/?my-keyword-here$/about.php[L]所以现在如果您在浏览器的URL地址栏中输入http://www.mysite.com/my-keyword-here,您将返回/about的内容。php.

.htaccess - 使用 mod_rewrite 将动态 URL 转换为 SEO 友好 URL ??

我不是PHP开发人员,我被要求执行一些SEO。这是我的.htaccessRewriteEngineOnRewriteBase/RewriteRule[_\]space.cgi[L]ErrorDocument404/errors/404.phpErrorDocument400/errors/badrequest.phpErrorDocument401/errors/authreqd.phpErrorDocument403/errors/forbid.phpErrorDocument500/errors/serverr.phpErrorDocument503/errors/ServiceU

url - mod_rewrite 和 "pretty urls"

我很遗憾地没有能力使用mod_rewrite来获得干净的、对SEO友好的url,但我真的下定决心要学习。我找到了各种在线教程,但似乎无法真正理解足够的信息来按照我喜欢的方式操作它。Ihaveahomepage:http://mysite.com/index.htmlwhichIwouldliketodisplayas:http://mysite.com/home同样,我有子目录:http://mysite.com/about/index.htmlhttp://mysite.com/contact/index.phpWhichIwouldliketodisplayashttp://mys

php - 在 mod 重写中忽略动态路径并保留子路径

我有一个带有动态路径的网站,我需要知道如何保留一部分或忽略它:动态路径的几个例子:http://www.example.com/185/seo-dynamic-field.htmlhttp://www.example.com/186/seo-dynamic-field2.html如您所见,seo-dynamic-field.html是从mysql生成的字段,仅用于友好的url。id(185&186)是处理真实查询字符串的真实ID:RewriteRule^/*(([^/]+)(.html))$index.php?id=$2[L]这是有效的:http://www.example.com/1

mod-rewrite - 修复编码 "http://"的 Apache URL 重写技巧

我有一些导致最终格式不正确的网站,例如:http://www.mydomain.com/directory/http%3A%2F%2Fwww.another.com%2Falink-that-doesnt-work我想要一个重写规则来截断该部分直到url并修复编码以重定向到http://www.another.com/alink-that-doesnt-work谢谢 最佳答案 使用正则表达式从URL中提取主机名和链接,并使用反向引用进行替换和重定向。请注意,模式与解码的URL相匹配。RewriteEngineOnRewriteRul