-PROBLEM: I want to redirect the url of a javascript file by using htaccess:
–>From:
http://www.domain.co.uk/tracking/tracking.js
–>To:
http://www.domain.co.uk/templates/domain.co.uk/js/tracking.js
-MY HTTACESS (ALL THE TESTER ONLINE GIVE POSITIVE):
RewriteEngine on
RewriteRule ^tracking/tracking\.js$ http://www.domain.co.uk/Templates/domain.co.uk/js/tracking.js [L,R]
-RESULT
Not Found
The requested URL /tracking/tracking.js was not found on this server.
Apache/2.2.0 (Fedora) Server at domain.co.uk Port 80
-FOLDER STRUCTURE
/...
|
/http
|/Templates
| |/domain.co.uk
| |/js
| | - tracking.js
|- .htaccess
|- index.php
Because along the day I was testing many different ways, I’m starting to think is not because of the rewriterule, but if It’s not that, what might be?
I think you should include all basic directives for the rewrite to work. Like this:
If still doesn’t work, the problem most probably is with the Apache configuration file.
This rule set should be in .htaccess file at root directory