私はこれが欲しい:
http://www.website.com/test/view
実際にこれを呼び出すには:
http://www.website.com/index.php/test/view
次のような .htaccess ファイルを試してみましたが、うまくいかないようです:
RewriteEngine on
RewriteCond $1 !^index\.php
RewriteRule ^(.*)$ /index.php/$1 [L]
私は何が欠けていますか?
私はこれが欲しい:
http://www.website.com/test/view
実際にこれを呼び出すには:
http://www.website.com/index.php/test/view
次のような .htaccess ファイルを試してみましたが、うまくいかないようです:
RewriteEngine on
RewriteCond $1 !^index\.php
RewriteRule ^(.*)$ /index.php/$1 [L]
私は何が欠けていますか?
最初の行で「RewriteEngine On」を設定しましたか??
私はこれを一度使用しましたが、うまくいきました:
RewriteEngine On
RewriteRule ^([a-z\-]+)$ /index.php?page=$1 [L]
mod_rewrite と .htaccess を有効にしてからhttpd.conf、このコードをディレクトリの.htaccess下に配置します。DOCUMENT_ROOT
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php%{REQUEST_URI} [L]