• Resolved edroxter

    (@edroxter)


    Hey everyone,

    I’m wondering: Where is the /do/ folder in the plugin in the more recent versions? I set up a WordPress instance with “GreenNature” theme running. It has a content element “Subscribe”, and this has hardcoded the /wp-content/plugins/newsletter/do/subscribe.php URL in it for a newsletter subscription form.

    But when I try to subscribe to a newsletter, I get a 404 error. So I checked the FAQ first and then wanted to check if it’s a permission error or something like that…turns out the entire folder “do” doesn’t exist.

    I downloaded the Newsletter plugin zip file from the WordPress repository, just to encounter that the folder really isn’t there in the source files – and going through the entire history, it appears the “do” folder isn’t physically there anymore since version 4.6.2 (4.6.1 and before still have it).

    See also https://plugins.svn.wordpress.org/newsletter/tags/4.6.1/ vs. https://plugins.svn.wordpress.org/newsletter/tags/4.6.2/

    What is that about? I don’t understand, and of course, the 404 error speaks truth in my judgement, since the do/subscribe.php file doesn’t exist. Is the URL registered in another way after version 4.6.1? Should it work nonetheless, but there are other circumstances (interfering plugins) which prevent it from working? Any clue where to look?

    Thanks!
    Nico

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter edroxter

    (@edroxter)

    …anything on this?

    Same problem here!
    Solution: You have to replace the old form-action-URL in your custom subscription form. These forms are stored as static html-markup. they won’t be updated by the plugin.
    Go to wp-admin/admin.php?page=newsletter_subscription_forms and replace http://www.domain.tld/wp-content/plugins/newsletter/do/subscribe.php with http://www.domain.tld/?na=s
    docs: http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-forms

    Thread Starter edroxter

    (@edroxter)

    Thanks for the hint!

    My problem is: The URL is “hardcoded” in the “Subscribe” item of the template “GreenNature”, so I guess I’ll have to tell the developers of the theme to update this to reflect the new URL.

    maybe you can solve it with a workaround: url-rewriting in .htaccess?

    Thread Starter edroxter

    (@edroxter)

    …could’ve thought of that myself.

    Excellent advice, works flawlessly, thank you! 🙂

    Hi @edroxter,

    I’m having the same problem you are, except with less knowledge of coding.
    Could you guide me through what you changed in the url-rewriting in .htaccess?
    And where is .htaccess?

    thanks for your help !

    Thread Starter edroxter

    (@edroxter)

    Hi @alexis123987,

    usually, every WordPress installation ships a file named .htaccess (there really is nothing before the “.”, which is, under unixoid OSes the indicator for hidden files). You should see it when you connect to your webspace via FTP or SFTP, in the root folder of your WordPress installation (where the index.php, wp-config.php and a bunch of other root WordPress files reside). It should, by default, look like this:

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

    This tells the webserver (note: this ONLY works with webservers that respect .htaccess files, which is usually Apache – it won’t work with nginx, for example): Whatever is behind the / in the URL (for example: for https://www.yourdomain.com/my-fabulous-blogpost/ that would be “my-fabulous-blogpost/”) and doesn’t point to a really existing file, treat it as a call to index.php and let the script interpret the URL instead of the webserver software.

    So now you can use this logic to “simulate” that there is a file called /wp-content/plugins/newsletter/do/subscribe.php, but the webserver will internally call the URL /index.php?na=s (call to the Newsletter Plugin) and let it handle this.

    Long story short: Make your .htaccess file look like this:

    <IfModule mod_rewrite.c>
    RewriteEngine on 
    RewriteRule ^wp-content/plugins/newsletter/do/subscribe.php$ /index.php?na=s [L]
    </IfModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Changes should be reflected immediately, and it should work instantly. If it doesn’t, your webhosting provider is either caching .htaccess files (unlikely) or not using a webserver software like Apache which is capable of handling .htaccess files. In that case, you may either ask them to configure such a rewrite rule directly in the webserver configuration, or you’re out of luck.

    Also, please note that some WordPress updates and/or hardlink settings will change the .htaccess file and may delete your inserted lines, rendering the problem unsolved again. So you may check after every update, and also from time to time, if your rewrite rule (i.e. the first 4 lines of my example above) are still present in the file.

    Hope this helps!

    Hi,

    thanks for your quick and thorough reply.
    I inserted :

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^wp-content/plugins/newsletter/do/subscribe.php$ /index.php?na=s [L]
    </IfModule>

    in the htaccess file, but when i went to my site I got this message :

    “Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.”

    which made me flip a little as I already lost my site while trying stuff out.
    However, i managed to revert it back by deleting the lines of the htaccess file.

    Do you have another idea?

    Otherwise i ll just revert back to older versions of the pluggin which allows people to write their e-mail address and i ll send newsletters otherwise.

    thanks again for your help

    in case it helps, my site is : http://www.shantyoga.org
    on the main page there is the newsletter subscribe which leads to the 404 error.

    at @edroxer: it worked !!!!

    I made a mistake while copying the code, i took it from the email i received instead of from this thread (there were some differences).
    After 3 days of long and painful struggle with this pluggin it finally works !
    and that’s thanks to you.

    thank you soo much !

    Thread Starter edroxter

    (@edroxter)

    @alexis123987

    Sorry for the late reply, I was offline for the last two days – but I’m happy to hear that it worked for you, and you’re welcome! 🙂

    Plugin Author Stefano Lissa

    (@satollo)

    “do” folder has been remove time ago since that folder is most of the time blocked by security plugin. Just change the action of your subscription form from:

    http://www.domain.com/wp-content/plugins/newsletter/do/subscribe.php

    to

    http://www.domain.com/?na=s

    Thread Starter edroxter

    (@edroxter)

    @satollo

    Yes, this would of course be the “cleanest” option – but in my specific case, it’s a hard-coded content element of a theme called “GreenNature”. The form action for the newsletter element is fixed in a more recent version of the theme, but the web developer who bought the theme vanished into thin air, so I have no possibility of updating it without buying it again.

    Thus, the mod_rewrite hack is the only way to go for me now, unless I find a way to contact him again.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘/do/ folder not existent since version 4.6.2?’ is closed to new replies.