.htaccess 在 xampp 上导致内部服务器错误

.htaccess causes Internal Server Error on xampp

我有 .htaccess 文件,我写了两个这样的命令:

ReWriteRule ^member/(.*)$ /oz/photos.php?member=

ReWriteRule ^(.*)$ /oz/profile.php?username=

这是错误:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at postmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.4.29 (Win32) OpenSSL/1.0.2n PHP/5.6.33 Server at localhost Port 80

您的规则 ReWriteRule ^(.*)$ /oz/profile.php?username= 每次都在循环请求(递归或重定向循环)。规则中的所有选择器也在重定向重定向的请求。

尝试

ReWriteRule ^member/(.*)$ /oz/photos.php?member=
RewriteCond %{REQUEST_URI} !^/oz/.*
ReWriteRule ^(.*)$ /oz/profile.php?username=