doudiaozhi6658 2016-04-02 15:25
浏览 19

htaccess没有按照步骤明智的规则定义

My knowledge about htaccess says that once [L] flag is used, rules stand terminated and no further rules will be executed. But here dont know why rules are not working after i added following rule to my current htaccess.

 #### Redirect all non-file & non-directory url to Results.php ####
 RewriteCond %{SCRIPT_FILENAME} !-d
 RewriteCond %{SCRIPT_FILENAME} !-f
 RewriteRule ^.*$ ./Results.php [L]

All valid urls e.g. Job-Details.php are also redirecting to Results.php script.

Note : I have already checked after restarting all services of wamp server & cleared cache.

EDIT 1:- I got to know after spending more than 1 day reading that i was not able to explain what i want as solution. Big apologies for that.

Now, clear thought is, after Job-Details.php url rewriting, url becomes like http://domain.com/7997 i want, that this url should not go to Results.php by default though it's non-existing file/directory name & should use Job-Details.php script in place of Results.php.

I have tried using following code but no positive results.

Rewritecond %{REQUEST_URI} [^0-9/]$

How should i go? any expert advise?

My complete htaccess

Options +FollowSymLinks

### Start rewrite and set basedir
RewriteEngine on
Rewritebase /Domain.com/

########### Redirect all non-file & non-directory url to Results.php ############
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^.*$ ./Results.php [L]

########### Remove php extension ####################
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

########### Job detail page extension remove ####################
RewriteCond %{THE_REQUEST} Job\-Details\.php\?Job_ID\=(\d+) [NC]
RewriteRule ^ %1? [R=301,L,NE]

########### Result page extension ####################
#RewriteCond %{THE_REQUEST} Results\.php\?url\=([A-Za-z0-9-_]+) [NC]
#RewriteRule ^ %1? [R=301,L,NE]

I have tried searching logic behind this behavior but couldn't find any or i may have searched wrong pharse.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向