apache - RewriteRules stop working when I add a VirtualHost -


i have bunch of rewriterules working fine, , must exist every hostname server replies to. example:

rewriterule ^/file\.js /var/pear/package/file\.js [qsa,l] 

now, wanted force canonical names missing-slash-at-end-of-directory redirects. added:

<virtualhost *:80>   servername custom.name.com </virtualhost> 

that results if go http://custom.name.com/some_dir redirects http://custom.name.com/some_dir/

now, if go http://custom.name.com/file.js or http://original.host.name/file.js 404 instead of file in pear. if remove virtualhost 3 lines, goes working.

any ideas why?

edit 1:

tried serveralias instead of servername, same result.

edit2:

just setting virtualhost cause rewriterules stop working. empty enough.

it appears rule works default site.

try this

<virtualhost *:80>   servername custom.name.com   documentroot path/goes/here   <directory "path/goes/here">      ...      rewriterule ^/file\.js /home/y/share/pear/pacakge/file\.js [qsa,l]      ...   </directory> </virtualhost> 

i hope you

regards


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -