使用htaccess重定向无扩展名的页面 [英] Redirect a page without extension using htaccess

查看:62
本文介绍了使用htaccess重定向无扩展名的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要这样重定向页面:

I need redirect the page like this:

http://www.example.com/index.php

为此:

http://www.example.com/home

可以使用htaccess吗?如果答案是肯定的,怎么办?

Is this possible using htaccess? And if the answer is yes, how?

推荐答案

是的,这是可能的。将以下代码放入您的 .htaccess 文件中:

Yes, this is possible. Put the following code in your .htaccess file:

RewriteEngine on

RewriteRule ^home$ index.php



此网站中。这是一个很好的参考。


Have a look at this website. It is a good reference.

这篇关于使用htaccess重定向无扩展名的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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