开发者

Problem with htaccess rewrite rule when Apache server running on port other than 80

开发者 https://www.devze.com 2023-03-23 09:42 出处:网络
When server was running on port 80 everying was working smoothly with fallowing condition in .htaccess file. When server port is changed to 8008 in http.conf file 404 error displayed.

When server was running on port 80 everying was working smoothly with fallowing condition in .htaccess file. When server port is changed to 8008 in http.conf file 404 error displayed.

http://localhost/mysite/knw/kna00023 <-- works fine
http://loc开发者_高级运维alhost:8008/mysite/knw/kna00023 <-- 404 error

Folders:

apache dir c:\server\ 
php dir c:\server\php 
site folder c:\server\www\mysite -- contains website files

.htaccess content:

RewriteEngine On
#check url is not a valid file
RewriteCond %{REQUEST_FILENAME} !-f
#check url is not a valid directory
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^knw/([a-zA-Z0-9]+)$ other.php?term=$1 [L] 
RewriteRule ^knw/([a-zA-Z0-9]+)/$ other.php?term=$1 [L] 
0

精彩评论

暂无评论...
验证码 换一张
取 消