Apache简单重定向从一个页面到另一个页面(Apache simple redirect from one page to a second one)

编程入门 行业动态 更新时间:2024-10-22 09:44:39
Apache简单重定向从一个页面到另一个页面(Apache simple redirect from one page to a second one)

我需要从一个网址重定向到另一个网址

我见过的所有例子都使用reg表达式和我需要重定向的复杂语法

www.mydomain.com/page1.html

www.mydomain.com/page1replacement.html

我想它在.htaccess文件中,但是语法是什么?

Update1试过这个,但它无法正常工作:我需要重启apache吗?

Redirect 301 http://www.theprinterdepo.com/catalogsearch/result/index/?cat=100&q=1022&x=0&y=0 http://www.theprinterdepo.com/catalogsearch/advanced/result/?name=1022&sku=&price%5Bfrom%5D=&price%5Bto%5D=&free_shipping=&category=100

谢谢

I need to redirect from one url to another full url

all examples I have seen use reg expressions and complicated syntax I need to redirect from

www.mydomain.com/page1.html

to

www.mydomain.com/page1replacement.html

I suppose its in the .htaccess file, but what would be the syntax?

Update1 Tried this but its not working: Do I need to restart apache??

Redirect 301 http://www.theprinterdepo.com/catalogsearch/result/index/?cat=100&q=1022&x=0&y=0 http://www.theprinterdepo.com/catalogsearch/advanced/result/?name=1022&sku=&price%5Bfrom%5D=&price%5Bto%5D=&free_shipping=&category=100

thanks

最满意答案

这将进入.htaccess文件。 可以使用完整的URL。

Redirect 301 /page1.html http://mydomain.com/page1replacement.html

This goes into your .htaccess file. Full URLs can be used.

Redirect 301 /page1.html http://mydomain.com/page1replacement.html

更多推荐

本文发布于:2023-04-28 00:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329684.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   重定向   简单   Apache   redirect

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!