• Hi

    I’ve got my own whatever.php program, nothing to do with WP except that in one case it exists on the main root WP directory, and in another case it’s in a subdirectory that I’ve allowed in htaccess.

    Both programs take a while (5 minutes ish) to finish, and most of the time they work, but sometimes, or after a period, WordPress will deliver a 404. In one case I get my output, then the WordPress 404 content. In another case I just ran, I got 404, then I just reloaded and it worked fine.

    I’m a web dev but not massively familiar with WP. If there’s a better place for me to put my code, or a sure way of setting up a folder/htaccess so WP accepts it, I’d be grateful to know.

    I realise I could put my code up top and put WordPress in a subfolder, but I don’t really want to do that because WP is the main point of the site, my code is just doing other stuff in another database.

    Cheers
    J

Viewing 1 replies (of 1 total)
  • Hello,

    It would be a good idea to place that script into its own folder and exclude it via htaccess from WordPress redirects. It could be achieved with something like this:

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

    where mydir is the name of that folder.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘my own php gives occasional WP 404’ is closed to new replies.