简体   繁体   中英

Subfolder .htaccess not found

Hi friends i am getting this error anyona cen tell me how can i fix this error. The htaccess my htaccess file is this:

#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]

Not Found

The requested URL /profile/following/demo was not found on this server.

Apache/2.2.15 (CentOS) Server at prototype.kofendurance.com Port 80

Also i am getting same error all htaccess RewriteRule.

Your 1st rule to skip files or directories is not right and you need to uncomment opening lines:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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