和许多Web开发人员一样,当请求不是公用服务目录中存在的文件时,我喜欢使用.htaccess通过单个入口点将所有stream量引导到域。
所以像这样的东西:
RewriteEngine On # enable symbolic links Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+) index.php [L]
这意味着如果请求不是为了一个CSS文件或图像,我的index.php获取请求,我可以select做什么(提供一些内容或404可能)
很好,但我偶然发现了一个似乎无法帮助我解决的问题。
如何使用htacces从wwwredirect到https www?
奇怪的URL重写规则.htaccess问题需要解释
重写URL的Glype(nginx)
.htaccess重写友好的URL
将* .htmredirect到* .php
我的文档根目录如下所示:
asymboliclink -> /somewhere/else css .htaccess img includes index.php
然而,Apache没有看到作为目录的目录的符号链接。 它将请求传递到我的index.php根目录中。 我想提供链接,就好像它是一个文件夹,因为它是一个链接到它自己的index.php文件夹。 我可以通过在浏览器的地址栏中input来访问http://example.com/asymboliclink/index.php ,但我希望能够通过http://example.com/asymboliclink访问它
我需要添加到我的.htaccess文件来做到这一点?
转换htaccess到nginx
如何使用Apache / mod_rewrite基于Accept-Language进行redirect
在特定的htaccess文件中search和replace – linux
为什么Apache删除多个斜杠?
Apache – mod_rewrite – redirect一些pathHTTPS到HTTP
使用-l开关测试符号链接
RewriteEngine On # enable symbolic links Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+) index.php [L]
文档
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html – ctrl + f为“将TestString作为一个路径名,并测试它是否存在,并且是一个符号链接。
-l标志引用符号链接
RewriteEngine On # enable symbolic links Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+) index.php [L]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。