【发布时间】:2014-08-25 14:19:58
【问题描述】:
我无法在我的网站中使用子域。它返回为:
错误 500 ,内部服务器错误。
当我检查时,我发现问题出在我的 htaccess 文件上。
RewriteEngine On
Options -Indexes
RewriteRule ^contest/?$ contest.php [NC,L]
RewriteRule ^contest/(.+)/?$ contest.php?name=$1&id=htapappu [NC,L]
RewriteRule ^news/?$ news.php [NC,L]
RewriteRule ^news/(.+)/?$ news.php?newsid=$1 [NC,L]
RewriteRule ^projects/?$ projects.php [NC,L]
RewriteRule ^projects/(.+)/?$ projects.php?projectid=$1 [NC,L]
RewriteRule ^page/?$ page.php [NC,L]
RewriteRule ^page/(.+)/?$ page.php?feed=$1 [NC,L]
RewriteRule ^photos/?$ photos.php [NC,L]
RewriteRule ^photos/(.+)/?$ photos.php?catg=$1 [NC,L]
RewriteRule ^profile/complete/?$ complete_profile.php [NC,L]
RewriteRule ^profile/picture/?$ set_profile_pic.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ member.php?userismnob=$1&redirect=me [NC,L]
问题在最后一行。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ member.php?userismnob=$1&redirect=me [NC,L]
当我删除最后两行时,没有问题。我认为这是一个小问题。
【问题讨论】:
-
你想让这两行做什么?
-
@BernardoLima 如果用户在地址栏中输入此(www.mysite.com/username),则页面来自 www.mysite.com/member.php?userismnob=$1&redirect=me
-
www.mysite.com/usernameURL 是否获得 500?你能检查你的 Apache error.log -
@Abubhava:没有,www.mysite.com/username 没有问题。检查keralaphotography.org/shameel.kadannamanna
-
ok 在下面发布了答案。
标签: regex apache .htaccess mod-rewrite internal-server-error