<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ThinkPHP`5.0`在沒有啟用路由的情況下典型的URL訪問規則是: >[info] `http://serverName/index.php(或者其它應用入口文件)/模塊/控制器/操作/[參數名/參數值...]` ## URL大小寫 默認情況下,`URL`是不區分大小寫的(可在配置文件中鍵入`'url_convert' => false,` 設置`URL`訪問嚴格區分大小寫),也就是說`URL`里面的**模塊/控制器/操作名**會自動轉換為小寫,控制器在最后調用的時候會轉換為駝峰法處理。 例如: ~~~ http://localhost/index.php/Index/BlogTest/read // 和下面的訪問是等效的 http://localhost/index.php/index/blogtest/read ~~~ 這種URL不區分大小寫情況下,如果要訪問駝峰法的控制器類,則需要使用: ~~~ http://localhost/index.php/Index/blog_test/read ~~~ ## 隱藏入口文件 在ThinkPHP5.0中,出于優化的URL訪問原則,還支持通過URL重寫隱藏入口文件,下面以`Apache`為例說明隱藏應用入口文件index.php的設置。 下面是Apache的配置過程,可以參考下: 1、`httpd.conf`配置文件中加載了`mod_rewrite.so`模塊 2、`AllowOverride None`將`None`改為`All` 3、在應用入口文件同級目錄添加`.htaccess`文件,內容如下: ~~~ <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule> ~~~ 可以去掉URL地址里面的入口文件`index.php`,但是需要額外配置WEB服務器的重寫規則。 以`Apache`為例,需要在入口文件的同級添加`.htaccess`文件(官方默認自帶了該文件),內容如下: ~~~ <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule> ~~~ 如果用的`phpstudy`,規則如下: ~~~ <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] </IfModule> ~~~ 如果`index.php文件存放在public中`,規則如下: ~~~ <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1] </IfModule> ~~~ 接下來就可以使用下面的URL地址訪問了 ~~~ http://tp5.com/index/index/index http://tp5.com/index/index/hello ~~~ 如果你使用的`apache`版本使用上面的方式無法正常隱藏`index.php`,可以嘗試使用下面的方式配置`.htaccess`文件: ~~~ <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule> ~~~ 如果是`Nginx`環境(特別是phpstudy的nginx環境)的話,可以在`Nginx.conf`中添加: ~~~ location / { // …..省略部分代碼 if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看