1

私はできることをすべて試しましたが、URLの.htaccess書き換えに関するすべてのWebチュートリアルをチェックしましたが、私の問題をすべて独占的に解決したものはありませんでした。プログラミングの専門家がこれを手伝ってくれました。私はphp Webアプリケーションを持っています。リンクlocalhost/app/images.phplocalhost/app/images_ /images_ /images.php_ /images/miscellaneous_

/images.php?album_id=miscellaneous

私は得る

internal server error

これは私が今持っている .htaccess コードです。/images から /images.php にのみ一致します

# Turn on URL rewriting
RewriteEngine on
RewriteBase /ansjc
# Remove file extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) $1.php [L]
RewriteRule images/album_id/(.*)/ images.php?album_id=$1
RewriteRule images/album_id/(.*) images.php?album_id=$1 
4

2 に答える 2

0

このコードを使用

RewriteEngine on

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

RewriteRule ^([^/]*)$ $1.php [NC,L]
RewriteRule ^images/(.*)$ images.php?album_id=$1 [L]

そして試してみてください

http://localhost/images
http://localhost/images/
http://localhost/images/album_id

images.php を呼び出し、images.php 内では print_r($_GET); だけを呼び出します。テストする。

于 2013-05-23T18:48:46.340 に答える