本文介绍了重定向本地主机/ XXX为localhost /在WAMP xxx.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Ubuntu的/ Mac上,去,说,本地主机/页自动重定向到localhost / page.php。
但是,这并不在Windows中工作。如何做才能让你的东西,如本地主机/航空自卫队重定向到localhost / asdf.php?
解决方案
您可以通过两种方法实现这一点:
方法1:
`#1加载页面asdf.php但
航空自卫队显示在地址栏
的RewriteBase /网站
重写规则^([^ / \。] +)?$ $ 1.PHP`
方法2:
`#2加载页面asdf.php和
显示asdf.php在地址栏。
在R标志告诉Apache重定向到
网址。
的RewriteBase /网站
重写规则^([^ / \。] +)?$ $ 1.PHP [R]`
我希望这会帮助你。
In Ubuntu/Mac, going to, say, localhost/page automatically redirects to localhost/page.php.
But this doesn't work in Windows. How do you make stuff like localhost/asdf redirect to localhost/asdf.php?
解决方案
You can achieve this by two methods:
Method 1:
`#1- Loads the page asdf.php but
displays asdf in the address bar
RewriteBase /site
RewriteRule ^([^/\.]+)?$ $1.php `
Method 2:
`#2- Loads the page asdf.php and
displays asdf.php in the address bar.
The R flag tells Apache to redirect to the
url.
RewriteBase /site
RewriteRule ^([^/\.]+)?$ $1.php [R]`
I hope this will help you.
这篇关于重定向本地主机/ XXX为localhost /在WAMP xxx.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!