是否可以隐藏.php扩展名或在没有htaccess的URL中将.php替换为.html? [英] Is it possible to hide a .php extension or replace .php with .html in a URL without htaccess?

查看:76
本文介绍了是否可以隐藏.php扩展名或在没有htaccess的URL中将.php替换为.html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到答案,但是失败了。其他问题是,带有 htaccess

I have tried to find the answer, but I failed. Other questions are with htaccess.

我发现 这个问题 与我的问题类似,但是我没有得到答案。

I found this question similar of my question, but I did not get my answer.

我需要它 而没有.htaccess ,因为我没有 URL重写 在我客户的服务器中。

I need it without .htaccess, because I do not have permission of URL rewriting in my client's server.

如何实现?

推荐答案

如果您无权访问 .htaccess httpd.conf 文件,则您可以在Web服务器的前面设置一个代理(如nginx),将DNS记录指向该代理,然后让代理将请求从.html重写为.php以传递到您的Apache服务器。

If you don't have access to your .htaccess or httpd.conf file the you could set up a proxy (like nginx) in front of the web server, point the DNS record to this proxy and have the proxy rewrite the requests from .html to .php to pass on to your apache server.

但是,如果您无权访问.htaccess或httpd.conf文件,则可能无法控制DNS记录...

However, if you don't have access to .htaccess or httpd.conf files, you probably don't control the DNS records...

这篇关于是否可以隐藏.php扩展名或在没有htaccess的URL中将.php替换为.html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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