Help with mod_rewrite and Joomla

On my Joomla site, I've added some pretty straight forward RewriteRules to my .htaccess file. These are all individual rules, since I am changing the file structure of the site and do not want to break my old links.

RewriteRule ^content/view/54/48/$ /courses [R]

      

In addition to the existing rules that come with Joomla:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

      

If I comment on the existing Joomla rules, I can see that my rule is working correctly and when I type http://example.com/content/view/54/48/

, my browser address bar changes to http://example.com/courses

, however, if I leave these other rules, then Joomla does not know what to do with it (it gives "unknown component error"). If I type http://example.com/courses

directly then it works as expected, so I have a feeling that this is a problem with my rewrite and not with Joomla.

I thought RewriteRules act on each other sequentially. eg:

RewriteRule a b
RewriteRule b c   # a request for "a" will take you to "c"

      

I am on shared hosting, so unfortunately I cannot enable the log. Anyone have any advice for me?

+1


source to share


1 answer


Try changing [R] in your rule to [R, L] ...



+4


source







All Articles