• New Google cloud instance with Bitnami WordPress installed.

    I FTP in with FileZilla and of course I the user name: bitnami can download but can’t upload the .htaccess file, .htaccess has daemon owner. So I load plugin Yoast which has an .htaccess edit tool. I add a simple redirect after </IfModule> and the redirect doesn’t happen.

    Redirect 301 /name/ https://mydomainname.com/name-news/

    I download the .htaccess file from the server and yes the redirect 301 is in there.

    This should work. Any suggestions? Thanks.

    • This topic was modified 2 years, 11 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 8 replies - 1 through 8 (of 8 total)
  • It is a very common issue. Usually, it causes due to cache. Try clearing it and let me know if it worked.

    Thread Starter ten1010

    (@ten1010)

    I have tried clearing browser cache and I don’t have a cache plugin activated. Or do you mean to disable the cache in the server. Thanks.

    Can you send me the URL of your site?

    Dion

    (@diondesigns)

    Since Apache processes rewrites before redirects, you can’t use Redirect on non-existent files/directories if the WordPress rewrite block is active. You should instead create a RewriteRule statement to handle your redirect, and make sure to place it above the WordPress rewrite block. You may also need to add a RewriteEngine on statement above your new rewrite statement.

    Thread Starter ten1010

    (@ten1010)

    I put a RewriteEngine On and RewriteRule before the WordPress rewrites and still nothing. I stopped and started the bitnami stack and still nothing. Thanks.

    Dion

    (@diondesigns)

    That would tell me your new rewrite rule is incorrect. Can you post the contents of your .htaccess file with the new rewrite code, and put it inside a CODE block?

    Thread Starter ten1010

    (@ten1010)


    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domainname2.com [NC]
    RewriteRule ^(.*)$ https://mywebsite.com/domainname2-for-sale/$1 [L,R=301]

    RewriteEngine On
    RewriteRule ^/news1/$ /news2/ [R]

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    -domainname2.com DNS A Record is pointing to mywebsite.com IP address.
    -permalinks are set to /%postname%/

    Thread Starter ten1010

    (@ten1010)

    I was editing and old useless .htaccess file.

    for secruity reasons Bitnami has moved the configuration of .htaccess file to the main application bitnami configuration files.

    Some plugins, during their installation, create a .htaccess file in either the /opt/bitnami/apps/APPNAME/htdocs/ or in the
    /opt/bitnami/apps/APPNAME/htdocs//plugins directory that cannot be read by Apache. For that reason, we recommend moving the
    content of that file to the /opt/bitnami/apps/APPNAME/conf/htaccess.conf file.

    https://docs.bitnami.com/aws/apps/wordpress/administration/use-htaccess/

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘New custom rules in .htaccess not working??’ is closed to new replies.