• Hi,

    Sometimes my RSS feed shows a Not found 404 page and when i re-save manually my permalinks, i manage to see the RSS again.

    It’s not a database corruption or .htaccess permissions issue and it appears that this is a common WP issue (bug?).

    I tought of having a Cron Job in my Cpanel to re-save my permalinks every 15 min or so; that way, my RSS will never be a Not found page more than 15 minutes.

    Could you advise on the correct syntax of this Cron Job command? and any advice on how to set up this cron job correctly.

    Thanks

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

    (@selmab)

    Thank you for your response but it’s so far from what i am asking for.

    I’m looking for the exact command to fill in in my cron job from the CPANEL NOT how to make cron jobs especially if it’s about affecting the default cron-job.php from WordPress which can screw up my scheduled posts.

    Just the syntax of the command allowing to save the permalinks, just that!

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    There’s no built CLI for WordPress although http://wp-cli.org/ is an amazing idea (which is on my to do list of things to play with…)

    Your permalinks shouldn’t be changing. Once they’re set they should remain set. Are you sure that your .htaccess file is not being deleted or modified? That would have the same effect.

    Thread Starter Selmab

    (@selmab)

    Hi Jan

    No i don’t modify my .htaccess but for some reason the RSS become a 404 not found page. It seems that it’s a common problem reported in WordPress forums without known fix.

    The only workaround is to re-save the permalinks.

    Rather than doing it manually, i look for an automated way to do it.

    I just had a look on http://wp-cli.org/ and did not find any command related to PErmalinks. Also, my website is on shared hosting so not sure if i can use such tool.

    Thanks for helping

    Thread Starter Selmab

    (@selmab)

    I just found this https://github.com/wp-cli/wp-cli/blob/0d5c37641a1fa971ae2eeed4d345e8abb71ac81f/php/commands/rewrite.php

    But seems too complicated related to my query i guess.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Can you provide a link to that RSS feed? As long as .htaccess is intact, mod_rewrite is enabled and active then the .htaccess sends the feed URL to WordPress like any other fancy link.

    There could be a conflict with a plugin or your theme. Have you performed any troubleshooting? All saving your permalinks does is re-save the .htaccess file.

    Can you make a copy of that file and then when the problem occurs do a diff on that .htaccess file with the copy?

    Thread Starter Selmab

    (@selmab)

    I have this issue with 2 different Hosting providers so it can’t be a mod_rewrite glitch. I’ve seen in many forums this issue reported; it’s not related to the database being corrupted as permalinks value is stored there.

    The only workaround that fix things is to re-save permalinks manually; that’s weird.

    Some talk about conflict between wordpress and feedburner and i know that my website use feedburner somehow (a link to feedburner feed in my right sidebard and in other parts of the php code)

    My Rss is http://www.YesIJob.com/feed

    Here is a copy of my .htaccess now the feed is showing well:

    # Use PHP5.4 Single php.ini as default
    #AddHandler application/x-httpd-php54s .php
    
    # 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
    
    # START Compression
    <IfModule mod_deflate.c>
    # compress text, html, javascript, css, xml, (and more):
        # compress text, html, javascript, css, xml, (and more):
    	AddOutputFilterByType DEFLATE text/css text/plain text/html text/richtext
    	AddOutputFilterByType DEFLATE text/javascript application/x-javascript application/javascript application/json
    	AddOutputFilterByType DEFLATE text/x-component image/svg+xml text/xsd text/xsl text/xml image/x-icon
    </IfModule>
    # END Compression
    
    # START Expires
    <IfModule mod_expires.c>
    	ExpiresActive On
    	ExpiresDefault "access plus 1 month"
    
    # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
      ExpiresByType text/cache-manifest       "access plus 15 minutes"
    
    # Your document html
      ExpiresByType text/html                 "access plus 15 minutes"
    
    # Data
      ExpiresByType application/json          "access plus 15 minutes"
      ExpiresByType application/xml           "access plus 15 minutes"
      ExpiresByType text/xml                  "access plus 15 minutes"
    
    # Feed
      ExpiresByType application/atom+xml      "access plus 1 hour"
      ExpiresByType application/rss+xml       "access plus 1 hour"
    
    # Favicon (cannot be renamed)
      ExpiresByType image/x-icon              "access plus 1 week"
    
    	ExpiresByType image/gif "access plus 1 month"
    	ExpiresByType image/png "access plus 1 month"
    	ExpiresByType image/jpg "access plus 1 month"
    	ExpiresByType image/jpeg "access plus 1 month"
    	ExpiresByType image/ico "access plus 1 month"
    	ExpiresByType text/css "access plus 1 year"
    	ExpiresByType text/javascript "access plus 1 year"
    </IfModule>
    # END Expires

    I’ll paste the same .htaccess next time the RSS shows as a not found 404 page.

    Thank you for your help.

    Thread Starter Selmab

    (@selmab)

    My custom permalinks use http://website/sample-post/

    Thread Starter Selmab

    (@selmab)

    Now my RSS is a 404 not found page, here is a copy of my .htaccess:

    # Use PHP5.4 Single php.ini as default
    #AddHandler application/x-httpd-php54s .php
    
    # 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
    
    # START Compression
    <IfModule mod_deflate.c>
    # compress text, html, javascript, css, xml, (and more):
        # compress text, html, javascript, css, xml, (and more):
    	AddOutputFilterByType DEFLATE text/css text/plain text/html text/richtext
    	AddOutputFilterByType DEFLATE text/javascript application/x-javascript application/javascript application/json
    	AddOutputFilterByType DEFLATE text/x-component image/svg+xml text/xsd text/xsl text/xml image/x-icon
    </IfModule>
    # END Compression
    
    # START Expires
    <IfModule mod_expires.c>
    	ExpiresActive On
    	ExpiresDefault "access plus 1 month"
    
    # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
      ExpiresByType text/cache-manifest       "access plus 15 minutes"
    
    # Your document html
      ExpiresByType text/html                 "access plus 15 minutes"
    
    # Data
      ExpiresByType application/json          "access plus 15 minutes"
      ExpiresByType application/xml           "access plus 15 minutes"
      ExpiresByType text/xml                  "access plus 15 minutes"
    
    # Feed
      ExpiresByType application/atom+xml      "access plus 1 hour"
      ExpiresByType application/rss+xml       "access plus 1 hour"
    
    # Favicon (cannot be renamed)
      ExpiresByType image/x-icon              "access plus 1 week"
    
    	ExpiresByType image/gif "access plus 1 month"
    	ExpiresByType image/png "access plus 1 month"
    	ExpiresByType image/jpg "access plus 1 month"
    	ExpiresByType image/jpeg "access plus 1 month"
    	ExpiresByType image/ico "access plus 1 month"
    	ExpiresByType text/css "access plus 1 year"
    	ExpiresByType text/javascript "access plus 1 year"
    </IfModule>
    # END Expires

    What do you think?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Looks the same to me. When this happens only the /feed/ URL is not working? What about the other URLs?

    Thread Starter Selmab

    (@selmab)

    It happen only with the Feed;

    By the way, after i posted my latest response the feed became again a 404 error page and i did resave the permalinks again!

    I have many scheduled WP posts every day, could it be the issue?

    Thread Starter Selmab

    (@selmab)

    Maybe it comes from scheduled posts? Because between my Two latest respones when the feed has become a 404 not found age, the only event in my website was that a scheduled post has gone published (Live).

    But if that’s the case, how come one or many scheduled posts cause this error? Time/Date glitsh?

    Thread Starter Selmab

    (@selmab)

    Hi Jan

    Do you see where it can come from?

    Thread Starter Selmab

    (@selmab)

    Actually it was a hosting side issue; it’s working fine now.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to make a Cron Job to Re-Save Permalinks?’ is closed to new replies.