简体   繁体   English

找不到PHP htaccess重定向页面

[英]PHP htaccess redirect page not found

I have one website in which I am fetching the the data using htaccess rule the URL but it always redirect to page not found. 我有一个网站,我在其中使用htaccess规则获取URL的数据,但始终将其重定向到未找到的页面。 If I use the direct URL instead of htaccess url then it works fine. 如果我使用直接URL而不是htaccess url,则可以正常工作。

Nice url: http://apis.jaspee.com/services/getCMS?pageid=2 好的网址: http//apis.jaspee.com/services/getCMS?pageid = 2

Real url: http://apis.jaspee.com/services/srvcRest.php?rqst=getCMS&pageid=2 实际网址: http//apis.jaspee.com/services/srvcRest.php? rqst = getCMS&pageid = 2

.htaccess code: .htaccess代码:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^(.*)$ srvcRest.php?rqst=$1 [QSA,NC,L]

    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.*)$ srvcRest.php [QSA,NC,L]

    RewriteCond %{REQUEST_FILENAME} -s
    RewriteRule ^(.*)$ srvcRest.php [QSA,NC,L]
</IfModule>

<Limit GET POST PUT DELETE>
    Allow from all
</Limit>

Can anyone say what's wrong I am doing? 谁能说我在做什么错?

You don't want services/ to be sent to your rqst parameter: 您不希望将services/发送到rqst参数:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^services/(.*)$ services/srvcRest.php?rqst=$1 [QSA,NC,L]

    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^services/(.*)$ services/srvcRest.php [QSA,NC,L]

    RewriteCond %{REQUEST_FILENAME} -s
    RewriteRule ^services/(.*)$ services/srvcRest.php [QSA,NC,L]
</IfModule>

<Limit GET POST PUT DELETE>
    Allow from all
</Limit>

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

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