• RyanMasterson

    (@ryanmasterson)


    Hello,
    I had to set up a blog that has a Site Address different from the WordPress Address in Settings > General. Now WordPress can’t write to the .htaccess file. I want to use a plugin (W3 Total Cache) that wants access to write to it. How can I accomplish this?

    Thanks,
    Ryan

Viewing 7 replies - 1 through 7 (of 7 total)
  • esmi

    (@esmi)

    Now WordPress can’t write to the .htaccess file.

    Why?

    Thread Starter RyanMasterson

    (@ryanmasterson)

    I don’t know.

    According to https://codex.www.ads-software.com/Using_Permalinks#Where.27s_my_.htaccess_file.3F “WordPress’s index.php and .htaccess files should be together in the directory indicated by the Site address (URL) setting on your General Options page.”

    The .htaccess file is not in the same directory as my Site Address.

    I noticed that WP could no longer write the .htaccess file after I made custom permalinks. At the bottom of the Settings > Permalinks the page now says, “If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file.” Though actually the custom permalinks still work fine.

    esmi

    (@esmi)

    So why isn’t the .htaccess file in the directory indicated by the Site address?

    Thread Starter RyanMasterson

    (@ryanmasterson)

    The Site address is a different domain that is being displayed via reverse proxy, for example:

    WordPress address: https://www.cagsblog.com
    Site address: https://www.ccu.edu/blogs/cags

    Also, even though WP says it can’t write to the .htaccess file anymore, it is still reading it. For example if I manually edit the rewrite code as it says I should in following code, all pages except the landing page return an Internal Server Error.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blogs/cags/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blogs/cags/index.php [L]
    </IfModule>

    The reason for the reverse proxy is because there wasn’t a server or database available for me to install WP on https://www.ccu.edu so we’re just making it look like it’s coming from that domain.

    esmi

    (@esmi)

    In that case, I don’t think you are going to be able to use W3 Total Cache. WordPress was never designed to run across two different domains.

    Thread Starter RyanMasterson

    (@ryanmasterson)

    Besides this one instance, WordPress works just fine in this setup.

    I suppose my only option is to manually edit the .htaccess file since it is still being read by WP. It think that’s kind of strange, but I don’t see another solution.

    Thanks for your responses, esmi.

    I don’t see how W3TC can be used in this way right now sorry.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How can I make .htaccess writable with different Site Address?’ is closed to new replies.