• Hi,

    I am having issue with custom ‘wp-content/uploads’ url rewrite.

    I have “renamed” the ‘wp-content/uploads’ folder to ‘files’ in the module settings.

    However, I would like direct links to “wp-content/uploads” to be accessible at the same time WITHOUT redirecting it to 404 page, or rather it should be redirected/rewritten to ‘files’.

    How should I go about changing the rules in .htaccess to remove the 404 redirection and to 301 redirect it/rewrite the URL?

    Below is the existing rules in .htaccess:

    
    # BEGIN WP Hide & Security Enhancer
    ...
    RewriteRule ^files/(.+) /wp-content/uploads/$1 [L,QSA]
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^wp-content/uploads/(.+) /index.php?wph-throw-404 [L]
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    ...
    # END WP Hide & Security Enhancer
    

    If i try to put the following rule all the way at the top of htaccess, it will say TOO_MANY_REDIRECTS:
    RewriteRule ^wp-content/uploads/(.+)$ /files/$1 [R=301,L]

    Please help, thanks

    • This topic was modified 8 years, 7 months ago by jayden34638.
Viewing 1 replies (of 1 total)
  • Plugin Contributor Maya

    (@tdgu)

    Hi,
    You don’t need to do that, just make sure the Block uploads URL is set for No

    Thanks

Viewing 1 replies (of 1 total)

The topic ‘htaccess too many redirect’ is closed to new replies.