.htaccess htaccess中的动态重写规则
我正在尝试重写动态重写url我想更改url.htaccess htaccess中的动态重写规则,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我正在尝试重写动态重写url我想更改url www.mysite.com/page.php?title=About Us with this www.mysite.com/about-us 我是这样做的 RewriteRule ^about-us$ page.php?title=About\ Us [NC,L] 但我想它应该是动态的新来的新网页,我不想手动添加链接到htaccess 我试过了 RewriteRule ^(.+)$ flights-detail1.php?dest=$1 但这
www.mysite.com/page.php?title=About Us
with this
www.mysite.com/about-us
我是这样做的
RewriteRule ^about-us$ page.php?title=About\ Us [NC,L]
但我想它应该是动态的新来的新网页,我不想手动添加链接到htaccess
我试过了
RewriteRule ^(.+)$ flights-detail1.php?dest=$1
但这对我不起作用。需要专家建议,请重定向所有页面:
www.mysite.com/about-us
www.mysite.com/other
www.mysite.com/etc
像这样
RewriteRule ^about-us$ page.php?title=About\ Us [NC,L]
www.mysite.com/page.php?title=about-us
在.htaccess中:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^page\.php
RewriteRule ^(.+)$ page.php?title=$1 [L,QSA]
你有什么问题吗?我只是在这里用一台服务器进行测试,效果很好。。。查看您的ftp软件是否以文本模式(非二进制)发送了.htaccess文件。该文件显示空白页,没有任何数据。就像我在浏览page.php而不是page.php?title=关于我们在本例中,
RewriteRule
work。尝试在页面.php中显示标题是什么
。。。或phpinfo()代码>我不知道它没有显示任何结果。我不知道为什么。我在这个页面上有一个mysql查询:$req\u page=$\u REQUEST['title']$page\u query=mysql\u query(“选择page\u meta\u title
,page\u meta\u description
,page\u meta\u关键字
,page\u title
,page\u text
FROMpage
其中page\u name
=“$req\page”)$page\u fetch=mysql\u fetch\u数组($page\u query);