如何获得mod-rewrites和php 301重定向?

时间:2021-10-21 11:04:14

I was hoping someone could also guide me on setting a redirect on a php site pcs4cheap.ca ....I tried to do mod re-writes through the .htaccess, works fine but prevents any othe login or admin page to open !

我希望有人也可以指导我在php网站pcs4cheap.ca上设置重定向....我试图通过.htaccess进行mod重写,工作正常,但阻止任何其他登录或管理页面打开!

Any other way I could achieve this would be much appreciated =)

我可以实现这一点的任何其他方式将非常感激=)

1 个解决方案

#1


Check out this question:

看看这个问题:

How best to redirect a webpage without using javascript

如何在不使用javascript的情况下重定向网页

In PHP it's done by using the header() function.

在PHP中,它是通过使用header()函数完成的。

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");
exit;

#1


Check out this question:

看看这个问题:

How best to redirect a webpage without using javascript

如何在不使用javascript的情况下重定向网页

In PHP it's done by using the header() function.

在PHP中,它是通过使用header()函数完成的。

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");
exit;