Hello,

I would like to use Apache Mod Rewrite to maintain search engines friendly URL over my web applications.

When I set some rules to change a URL such as mydomain.com/index.php?cat=articles&Id=124 to something like mydomain.com/articles/124.html this leads to all CSS and javascript files linked to index.php to be not available and hence the appearance of the page becomes incorrect and also javascript's errors are generated.

Is there any ideas to overcome this problem?

I also mentioned on Joomla that it able to change the mode of its URLs to be query strings or search friendly and I wonder how can they do that without changing the href values of their application files?!!

    yes. you need to set rewrite conditions. Bsically you either put in that the extention should be php or that it schould not be css / js

    note that you are not in the right forum for non php questions; check e.g., clientside technology forum

      You maen that I have to write new rules for files of extensions css and js! Wow Well I think this may solve the problem.

      By the way this topic is not clientside, because mod rewrite is a part of the server. while the regular expression that should be used in in the .htaccess is regrded as code.

      However, Thank you for your valuable help

        You will want to add a RewriteCond before your RewriteRule that checks to make sure the URL is for a PHP file before rewriting it

        RewriteCond %{HTTP_HOST} \.php$
          Write a Reply...