0

I have a webiste on which I use permalinks like /%category%/%postname%/ .

They were working fine a week or two ago. Now when I want to enter a page a get an error telling me that the page is not redirected correctly.

I have no redirects made in my htaccess file. NONE. If I change the permalinks to default then every page/post works fine.

I do not know what to do. Please help

Here is the .htaccess

<ifModule mod_headers.c>
  ExpiresActive On
  # Expires after 1 month
  <filesMatch ".(gif|png|jpg|jpeg|ico|pdf|js|htm|html|txt)$">
    Header set Cache-Control "max-age=2592000"
  </filesMatch>
  # Expires after 1 day
  <filesMatch ".(css)$">
    Header set Cache-Control "max-age=2592000"
  </filesMatch>
</ifModule>
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
</IfModule>
# END W3TC Browser Cache
# 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
  • Please edit your question and put all the content you now have in the .htaccess – Pikk Nov 04 '13 at 10:11
  • I've updated the question with the htaccess code – Constantin Rauliuc Nov 04 '13 at 10:19
  • What's the error message that you receive? Error page? Blank page? Will the permalinks work if you temporarily disable W3TC? – Pikk Nov 04 '13 at 10:27
  • Why would I disable W3TC? I did it any way, and still nothing. I've deleted all chaces and deactivated and nothing. – Constantin Rauliuc Nov 04 '13 at 10:34
  • That was just a test to see if W3TC .htaccess code was the root cause. If it's not then, it's somewhere else. What about the error message? – Pikk Nov 04 '13 at 10:37
  • My firefox says "The page isn't redirecting properly" and I can see in the console there are many request to my page. the same page every time. – Constantin Rauliuc Nov 04 '13 at 10:39
  • Does this happens to all pages or just few? also try to disable all plugins (and clear browser cache) and test again. – ViliusL Nov 04 '13 at 10:42
  • If I disable all plugins and enabled them back will all settings in them be saved? be the same? I never did this... – Constantin Rauliuc Nov 04 '13 at 10:44
  • This happens to all pages and posts, not to categories where i can see the posts titles – Constantin Rauliuc Nov 04 '13 at 10:45
  • have you always had the ` /%category%/%postname%/` structure or you had some other kind of structure before? Did you try to go back to the permalink page in the WP-admin and click "save" once again? – Pikk Nov 04 '13 at 10:51
  • This structure is from the begining and it works fine on other 4 sites with same plugins and settings. I had the same problem on another site or this one I can't remmember and I changed the permalinks settings from /%category%/%postname%/ to default and then back to my settings and that solved the problem, but now Nothing will work. – Constantin Rauliuc Nov 04 '13 at 10:55
  • I would try to disable all the plugins. If it doesn't work, backup the .htaccess. Then go and remove the permalinks from the wp-admin. Then delete the .htaccess from the server. Then re-enable the permalinks and see if it works. Try also using different browsers, because in some cases browsers may mess with cookies - and try always CTRL+F5 in order to refresh the pages. – Pikk Nov 04 '13 at 10:58
  • update question with active plugin list, WP version, if you modified WP or not, this will help. Btw if plugins are really good, you can safely turn off/turn on them without loosing, data, but in general it depends. To disable all plugins quickly - rename /wp-content/plugins/ folder to /wp-content/plugins-off/ – ViliusL Nov 04 '13 at 10:59
  • UPDATE! I've moved all plugins in a folder called pluginsss and created the original one again, and my permalinks structure works fine. Now I am putting them back one by one to find the one that makes all of those redirects – Constantin Rauliuc Nov 11 '13 at 09:06
  • @ViliusL I've moved back all my plugins and now my permalink structure still works. I Can not find why that hapened. Now it isn't hapening anymore. – Constantin Rauliuc Nov 11 '13 at 09:57
  • so everything is fine now? if yes, create short answer what steps you did and accept it, that other visitor will find help in future. BTW it is diffucult to answer why this happened... – ViliusL Nov 11 '13 at 11:20

1 Answers1

0

Very general way to fix wordpress redirect issues: (should work in all cases)

  1. /wp-admin/options-permalink.php Click "save changes". this will refresh WP redirect rules.
  2. check .htaccess, try to comment everything except WP part.
  3. Try to temporary disable plugins. Quick way is to rename wp-content/plugins/ folder, WP will not disable plugins, just will not load them. ATTENTION: do not visit /wp-admin/plugins.php when wp-content/plugins/ is renamed, becouse WP would auto disable them all.
  4. check your themes files, functions.php, try to activate WP another/default theme for test.
  5. If above do not work, download new fresh WP version.

TIP: try to never change files in wp-admin/ or wp-includes/ folder. These gives disaster in future.

ViliusL
  • 4,589
  • 26
  • 28