[moka同学笔记]window下.htacess文件 与linux下.htacess文件

Posted 清风徐来工作室

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[moka同学笔记]window下.htacess文件 与linux下.htacess文件相关的知识,希望对你有一定的参考价值。

windows下

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect hidden files from being viewed
<Files .*>
    Order Deny,Allow
    Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
#linux
#RewriteRule .* index.php/$0 [PT]
#wodows
RewriteRule ^(.*)$ /index.php?/$1 [L]

linux下

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect hidden files from being viewed
<Files .*>
        Order Deny,Allow
        Deny From All
</Files>

# Protect application and system files from being viewed
#RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

 
























以上是关于[moka同学笔记]window下.htacess文件 与linux下.htacess文件的主要内容,如果未能解决你的问题,请参考以下文章

[moka同学笔记]Yii下国家省市三级联动

[moka同学笔记]php的安装配置redis

[moka同学笔记]使用git的一个简单的流程

[moka同学笔记]Yii2 自定义class自定义全局函数(摘录)

[moka同学笔记]redis练习Demo

[moka同学笔记]Yii2.0课程笔记(魏曦老师教程)