0

以下のように、既存のディレクトリ/ blog(およびのようなもの/blog(/*))を取得して、存在しないディレクトリとともにindex.phpにリダイレクトしようとしています。

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

RewriteRule ^blog(.*)$ /index.php/$1 [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/$1 [L]

ErrorDocument 404 404.shtml

私はこれまでに約1000のことを試しましたが、何も機能しませんでした。

4

2 に答える 2

0

httpd.confでallowoverrideをallに設定しましたか?

于 2013-01-05T19:21:15.707 に答える
0

次のことを試してください。

RewriteEngine On

RewriteRule blog /index.php [L]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
于 2013-01-05T19:24:01.847 に答える