这是代码,用于删除文件扩展名。我也想删除目录名称。在此代码中添加什么。project = airgle的结构是包含导航页的索引页。
现在,我的网址是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]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句