Let me explain by example...
File: /var/www/example.com/public/wp-content/cache/minify/.htaccess
<IfModule mod_rewrite.c> # THIS WORKS... RewriteBase /wp-content/cache/minify/ RewriteRule /w3tc_rewrite_test$ ../../plugins/w3-total-cache/pub/minify.php?w3tc_rewrite_test=1 [L] RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -f RewriteRule (.*) $1%{ENV:APPEND_EXT} [L] RewriteRule ^(.+/[X]+\.css)$ ../../plugins/w3-total-cache/pub/minify.php?test_file=$1 [L] RewriteRule ^(.+\.(css|js))$ ../../plugins/w3-total-cache/pub/minify.php?file=$1 [L] </IfModule> File: /etc/apache2/httpd.conf
<Directory /var/www/example.com/public> AllowOverride None Options -MultiViews [...] <IfModule mod_rewrite.c> Options +FollowSymlinks # Options +SymLinksIfOwnerMatch RewriteEngine On # RewriteBase / </IfModule> [...] <IfModule mod_rewrite.c> # BUT THIS ISN'T WORKING!!! RewriteBase /wp-content/cache/minify/ RewriteRule /w3tc_rewrite_test$ ../../plugins/w3-total-cache/pub/minify.php?w3tc_rewrite_test=1 [L] RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -f RewriteRule (.*) $1%{ENV:APPEND_EXT} [L] RewriteRule ^(.+/[X]+\.css)$ ../../plugins/w3-total-cache/pub/minify.php?test_file=$1 [L] RewriteRule ^(.+\.(css|js))$ ../../plugins/w3-total-cache/pub/minify.php?file=$1 [L] </IfModule> [...] </Directory> For performance, I want to disable use of .htaccess on my server, and use the httpd.conf configuration file instead, which is what you can see above.
The thing is, the .htaccess rule which is placed in the specific directory (/var/www/example.com/public/wp-content/cache/minify/) works, but the same rule in my httpd.conf file doesn't. I am not sure why. What could I be doing wrong here?
<Directory /var/www/example.com/public>andRewriteBase /wp-content/cache/minify/for the mod_rewrite rule, which, I believe, should be equivalent..htaccessfile with# THIS WORKS...and thehttpd.conffile with# BUT THIS ISN'T WORKING!!!. Both files have four rewrite rules in them and one of the rules is preceded by a rewrite condition. You also don't explain what happens when the rule doesn't work. It might help to also give an example URL that you expect to match one of the rewrite rules.http://example.com/wp-content/cache/minify/000000/877fd/default.include-footer.489f00.js-- it's supposed to work, but it returns a 404 error as the rules aren't working. (Is that what you asked for?)