我已经尝试过此代码,但仍无法正常工作
这是我拥有的原始代码
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
#RewriteRule en en/
#RewriteRule id id/
RewriteRule id/(.*)$ $1
RewriteRule en/(.*)$ $1
这是我尝试过的代码
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME}\.php !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
#RewriteRule en en/
#RewriteRule id id/
RewriteRule ^(.*)$ id/(.*)$ $1.php [NC,L]
RewriteRule ^(.*)$ en/(.*)$ $1.php [NC,L]
并且输出显示“服务器遇到内部错误,无法完成您的请求。服务器超载或CGI脚本中存在错误。
答案 0 :(得分:-1)
尝试
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]