繁体   English   中英

找不到子文件夹.htaccess

[英]Subfolder .htaccess not found

嗨,朋友,我收到此错误,anyona cen告诉我如何解决此错误。 htaccess我的htaccess文件是这样的:

#Options +FollowSymLinks -MultiViews
#RewriteEngine On
#RewriteBase /

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^ - [L]

RewriteRule ^friends/([\w-]+)/?$ /friends.php?username=$1 [L,QSA]
RewriteRule ^followers/([\w-]+)/?$ /followers.php?username=$1 [L,QSA]
RewriteRule ^settings/([\w-]+)/?$ /settings.php?username=$1 [L,QSA]

RewriteRule ^messages/([\w-]+)/?$ chat.php?message_username=$1 [L,QSA]
RewriteRule ^following/([\w-]+)/?$ following.php?username=$1 [L,QSA]
RewriteRule ^following/([\w-]+)/([0-9]+)/?$ following.php?username=$1&page=$2 [L,QSA]
RewriteRule ^followers/([\w-]+)/?$ followers.php?username=$1 [L,QSA]
RewriteRule ^followers/([\w-]+)/([0-9]+)/?$ followers.php?username=$1&tpage=$2 [L,QSA]
RewriteRule ^photos/([\w-]+)/?$ userphotos.php?username=$1&page=$2 [L,QSA]
RewriteRule ^(.*/([a-zA-Z0-9_-]+)|([a-zA-Z0-9_-]+))$ profile.php?username=$1 [L,QSA]

未找到

在此服务器上找不到请求的URL / profile / following / demo。

prototype.kofendurance.com端口80上的Apache / 2.2.15(CentOS)服务器

另外我所有htaccess RewriteRule都收到相同的错误。

您跳过文件或目录的第一条规则不正确,您需要取消注释开头的行:

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /profile/

# skip real files and directories from all the rules
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# rest of the rules

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM