0

現在、php テンプレート/フレームワークを作成しています。今、アドバイスどおりに実行し、すべての通常のファイルをライブラリと構成を含むPUBLICフォルダーに配置し、index.phpをパブリックフォルダーに配置しましたが、MOD_WRITEを試してみましたが、何も機能しません-Coral8サーバーを使用しています(テスト)、それを行うようにすべて正しく構成しましたが、機能していないようです。

これが私が試したことです:

RewriteEngine on
RewriteRule ^public/?$ /public/index.php
RewriteRule ^public/([^/]+)/?$ /public/index.html

この

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    public/    [L]
    RewriteRule    (.*) public/$1    [L]
 </IfModule>`

この

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?url=$1 [PT,L]

</IfModule>

しかし、どれも機能していないようです:(前もって感謝しますが、間違いから学び、それを修正する方法を学ぶことができるように、誰かが私が間違っていることを教えてくれます。

ありがとうございました

4

2 に答える 2

0
RewriteEngine on
RewriteRule ^$ /public/index.html [L]
//made addition on index.html and put it first so that it is the first rule to be applied and then makes the condition for the next rule to apply 
RewriteRule (.*)\.html$ /public/?action=$1&%{QUERY_STRING}$ [L]
于 2013-06-25T14:54:58.773 に答える