Apache htaccess 网址缩短规则
我正在尝试创造一些东西 Short.com/ASWi7 -> Short.com/index.php?h=ASWi7
所以我尝试在 htaccess 上使用此代码
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule ^(.*)$ /index.php?hash=$1 [L]
,但网站丢失了 css 和所有内容...我在文件夹等中组织了我的网站... 那么我如何排除所有文件夹或某些文件成为该规则的一部分?
I'm trying to create something
short.com/ASWi7 -> short.com/index.php?h=ASWi7
so I tried using this code on my htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule ^(.*)$ /index.php?hash=$1 [L]
but the website loses the css and everything...i organized my site in folder etc...
so how can i exclude all the folders or cetain files to be part of that rule?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试以下操作:
!-f
检查现有文件!-d
检查现有目录希望有帮助。
Try the following:
!-f
checks for existing files!-d
checks for existing directoriesHope that helps.