0

I have a .htaccess on two servers. One is running Apache on CentOS, and one is running Apache2 on Ubuntu. The .htaccess file is there for the purposes of clean urls. Other than js and css files, everything should be re-directed to the /subdirectory/index.php file.

The /subdirectory/.htaccess file is:

RewriteCond %{REQUEST_URI} !(\.css|\.js)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)$ /subdirectory/index.php [L]

On the CentOS server, the redirect appears to work (and removing it, stops the clean urls from working)

http://example.com/subdirectory/widget/add 

gets redirected to

http://example.com/subdirectory/index.php

as required, and everything works fine. But on the Apache2/Ubuntu box, no such luck.

Is it there something missing from the .htaccess file for Apache2, or is that it's only working by fluke on the CentOS box in the first place. I'm 2 hours into this and it's driving me nuts.

4

0 回答 0