Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For whatever reason I can't seem to get my .htaccess file to work correctly on a local Wordpress install. What I'm trying to achieve is to have the themes assets paths rewritten as such:

 RewriteRule ^img/(.*)$ wp-content/themes/cashed/img/$1 [L]

The current location to my images folder is:

 wp-content/themes/cashed/img

and I'd like to change it to be

 img/

I've read a few posts about having to configure MAMP to allow for .htaccess files and I feel like I've configured them correctly.

I've edited the file: applications/MAMP/conf/apache/httpd.conf to have the following rules:

 <Directory />
     Options All
     AllowOverride All
     Order allow,deny
     Allow from all 
 </Directory>

I've also restarted MAMP.app as well as my machine many times and for whatever reason I feel that MAMP is ignoring this .htaccess file which is stored in the root directory of my WP install.

Any ideas?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Are you sure your default <Directory /> settings aren't getting overridden somewhere else?

I have mine directly in the vhost and .htaccess and rewrite rules work fine.

<VirtualHost *:80>
    ServerName wp.project
    DocumentRoot "/Users/chris/Sites/wp.project"

    <Directory "/Users/chris/Sites/wp.project">
        Options Indexes Includes FollowSymLinks  
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
share|improve this answer

Try using RewriteBase in your .htaccess file.

RewriteBase /siteyourworkingon/

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase

share|improve this answer
    
Was already set to RewriteBase / –  Bruno Jun 22 '12 at 17:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.