Php 是否删除文件夹名和文件扩展名?
这是用于删除文件扩展名的代码。我也想删除目录名。在此代码中添加什么。 project=airgle的结构是一个包含导航页面的索引页面 现在,我的url是Php 是否删除文件夹名和文件扩展名?,php,.htaccess,url,Php,.htaccess,Url,这是用于删除文件扩展名的代码。我也想删除目录名。在此代码中添加什么。 project=airgle的结构是一个包含导航页面的索引页面 现在,我的url是 localhost/demo/airgle/navigation1 我想要localhost/demo/navigation1 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] 您可以在/demo/.htacces
localhost/demo/airgle/navigation1
我想要localhost/demo/navigation1
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
您可以在
/demo/.htaccess
中使用此规则:
RewriteEngine On
RewriteBase /demo/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?! airgle/).+?)/?$ airgle/ [L,NC]
希望这段代码对您有所帮助
RewriteEngine On
RewriteCond %{HTTP_HOST} ^localhost/airgle/navigation1/file_name$
RewriteRule ^$ http://localhost/navigation1/file_name [L,R=301]
未找到此服务器上未找到请求的URL/demo/airgle/AirPurifiers。上面的.htaccess的位置是什么?这是放置在
/demo/
目录中的.htaccess吗?请向我推荐一些使用php的htaccess教程:)我还有一个问题,我在谷歌上搜索过,但没有找到更好的php OOPS教程,也请推荐。我真的很感激。谢谢你。