开发者

RewriteRule Pattern Problem after RewriteBase called

开发者 https://www.devze.com 2023-02-13 11:23 出处:网络
I want my js-files in the folder scripts to be redirected to a php which handels the caching. So the .htaccess looks like this:

I want my js-files in the folder scripts to be redirected to a php which handels the caching. So the .htaccess looks like this:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /eval/widget/scripts
RewriteRule ^(.*)\.js$ func.php?src=$1

The filename (without extension) should be passed to the php-file, but instead the src parameter is '开发者_StackOverflow中文版scripts/JAVASCRIPT_FILENAME'. What's wrong with this? Seems like RewriteBase doesn't set it correctly...


Change your rewrite rule to

RewriteRule ^.*?/(.*)\.js$ func.php?src=$1

You understanding of RewriteBase is incorrect.

0

精彩评论

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

关注公众号