.htaccess - Apache Mod_Rewrite Seems to be Causing Javascript Reloads -


I am setting up URL rewrite rules for an application that I am developing so that I use good clean URL Can do I should see the URL as http://app.com/page/agency/ and http://app.com/index.php?p=page& Agency = agency . Agency selector is optional, so I should redirect the URL, even if the agency is not present. I have created the following mod_rewrite rules for this purpose:

  Rewriteum ^ /? ([Az] +) / $ /index.php?p=$1 [PT] Remit Rules /? ([Az] +) / ([az] +) / $ /index.php?p=$1&agency=$2 [pt]  

To redirect this page working fine. However, it is that my javascript files are reloaded with each page being files, such as the browser believes that it is in a separate directory and I think it needs to reload js files is. JS files are linked via a link-coded URL, such as http://app.com/scripts/dostuff.js .

Is it possible to reload the browser every time JavaScript files? If so, then I have done something wrong

Try this code:?

  #RewriteEngine is a valid file or a valid directory RewriteCond% {REQUEST_FILENAME} -F [or] RewriteCond% {REQUEST_FILENAME} -d RewriteRule ^ - [L] except for the existing rewrite rules. # Single Path RewriteRule ^ ([about az] +) /? $ / IndexFP? P = $ 1 [L, QSA] writes again to write # 2 paths ^ ([AG] +) / ([AG] +) /? $ / IndexPP? P = 1 1 app; Agency = $ 2 [L, QSA]  

Comments