mod_rewrite - 使business.php成为文件夹
让 .htaccess (mod_rewrite) 工作起来非常困难 我的 .htaccess 文件中已经有这个用于友好 URL 的脚本 这很完美
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^article/(.*)/(.*)$ news_id.php?newsid=$1
但现在我想在主导航中隐藏我的文件扩展名...... ..so mypage.com/business.php
将变为 mypage.com/Business
我被告知添加 RewriteRule ^business$business.php [L]< /code>
...但它并没有减少它,谷歌已将我列入搜索黑名单,
我是否必须在 html/php 文件中的按钮中添加一些内容? ...这是按钮
我认为 php 文件没有连接到我的 .htaccess 但这不可能是因为 第一个重写规则有效
有什么建议吗?
Making .htaccess (mod_rewrite) work has been very difficult
I already have this script for friendly url in my .htaccess file
and that works perfect
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^article/(.*)/(.*)$ news_id.php?newsid=$1
But now I want to hide my file extension in the main navigation...
..so mypage.com/business.php
will become mypage.com/Business
I was told to add RewriteRule ^business$ business.php [L]
...but it doesn´t cut it and Google has blacklisted me for searching
Could it be I have to add something to the button in my html/php file?
...this is the button<li class="nav-business"><a href="business.php"></a></li>
I think the php-file doesn´t connect to my .htaccess but that can´t be because
this first Rewrite rule works
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想尝试这样的操作。要从 PHP 文件(例如 yoursite.com/wallpaper.php 到 yoursite.com/wallpaper)中删除 .php 扩展名,您必须在 .htaccess 文件中添加以下代码:
You might want to try something like this.To remove the .php extension from a PHP file for example yoursite.com/wallpaper.php to yoursite.com/wallpaper you have to add the following code inside the .htaccess file: