简体   繁体   English

在joomla1.5中执行重定向

[英]performing a redirect in joomla1.5

I have a situation in joomla in which I have to write the .htaccess file for redirects, such that if I type http://mysite.com/fold2 , it should redirect to http://mysite.com/fold1/fold2 , but the URL should be like mysite/fold2 . 我在joomla中遇到一种情况,我必须编写.htaccess文件进行重定向,这样,如果我输入http://mysite.com/fold2 ,它应该重定向到http://mysite.com/fold1/fold2 ,但网址应类似于mysite/fold2

Could you also tell me where is the best place in the .htaccess file to write this code? 您能否也告诉我.htaccess文件中编写此代码的最佳位置在哪里? Currently I think it is after: 目前我认为是在:

RewriteEngine On      

If you want to redirect using PHP, then add this code you the index.php file: 如果要使用PHP重定向,则将以下代码添加到index.php文件中:

<?php
header("Location: http://yourdomain.com/");
exit;
?>

If you want to redirect using .htaccess, then I believ this will work 如果您想使用.htaccess进行重定向,那么我相信这会起作用

Redirect 301 / http://yourdomain.com/

Hope this is what you are looking for 希望这是您要寻找的

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

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