• Hi,
    I faced a strange problem recently. My website’s new posts redirect to homepage.
    I upgraded wordpress to the newest version. Didn’t solve the problem.
    Also deactivated all the plugins. The same.
    Here’s the link:
    ???? ??????? ??????????
    I checked my .htaccess. Here’s the whole thing:

    # 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
    
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !(\.js|\.css|\.jpeg|\.jpg|\.png)$ [NC]
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
    
    # compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    
    # Or, compress certain file types by extension:
    <files *.html>
    SetOutputFilter DEFLATE
    </files>
    
    <ifModule mod_headers.c>
    Header set Connection keep-alive
    </ifModule>
    
    <IfModule mod_expires.c>
    # Enable expirations
    ExpiresActive On
    # Default directive
    ExpiresDefault "access plus 1 month"
    # My favicon
    ExpiresByType image/x-icon "access plus 1 year"
    # Images
    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"
    # CSS
    ExpiresByType text/css "access 1 month"
    # Javascript
    ExpiresByType application/javascript "access plus 1 year"
    </IfModule>

    The weird thing about it is that the older posts or the pages don’t redirect.

    Here’s the link to blog posts:
    https://www.dentalhome.ir/%D9%85%D9%82%D8%A7%D9%84%D8%A7%D8%AA-%D8%AA%D8%AC%D9%87%DB%8C%D8%B2%D8%A7%D8%AA-%D8%AF%D9%86%D8%AF%D8%A7%D9%86%D9%BE%D8%B2%D8%B4%DA%A9%DB%8C/
    (Sorry, the links contain Farsi letters; that’s why they are encoded.)

    Also I added some more posts. They all redirect to homepage.
    What could be the issue?

Viewing 1 replies (of 1 total)
  • Just try default .htaccess file for to be sure, if its your .htaccess or not.

    # 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

    Also in settings – permalinks re-save your permalink structure.
    You can also try temporary disable any /seo/redirection/security/cache/optimize plugin for troubleshooting.

Viewing 1 replies (of 1 total)
  • The topic ‘Post Redirects to Homepage’ is closed to new replies.