IT story

WordPress는 홈페이지를 제외한 모든 페이지에서 404 페이지를 찾을 수 없습니다.

hot-time 2020. 8. 7. 07:53
반응형

WordPress는 홈페이지를 제외한 모든 페이지에서 404 페이지를 찾을 수 없습니다.


갑자기 WordPress 웹 사이트로 이동하면 모든 페이지에 404 페이지를 찾을 수 없음 페이지가 표시됩니다. 나는 문제가 퍼머 링크 구조에 있다고 가정하고 있는데, 내가 만지지 않았다고 맹세 할 수 있었다. 영구 링크 설정은 "월 및 이름"에 있습니다.

이 문제의 유사한 사례를 온라인에서 조사했는데 많은 것이 .htaccess파일 과 관련이 있습니까? 찾기를 시도했지만 할 수 없습니다. 어떻게 든 삭제 되었을까요? 어디에 있어야하나요?

어떤 제안이라도 도움이 될 것입니다

물론 숨겨진 파일도 볼 수 있습니다.


.htaccess는 숨겨진 파일이므로 모든 파일을 ftp에 표시되도록 설정해야합니다.

permalink 구조를 기본값 (? p = ID)으로 되돌려 .htaccess가 문제인지 확인하는 것이 좋습니다.

그런 다음 "월 및 이름"구조를 다시 설정하고 작동하는지 확인할 수 있습니다.

PS : 3.1로 업그레이드하셨습니까? 이 경우 플러그인 문제가있는 사람들을 보았습니다.


당신이 아닌 다른 영구 링크 사용하는 경우 그 문제를 해결하는 것은 매우 간단 default같은 Day and name, Month and name, Numeric, Post name또는 Custom Structure, 당신은 단지 필요를

관리자 영역에 로그인하십시오 Settings > Permalinks.http://yoursite.com/wp-admin/options-permalink.php

선택 Default고유 주소 설정을 변경 저장 한 후,

그런 다음 다른 이전 영구 링크 선택으로 다시 되돌 리거나 원하는대로 유지할 수 있습니다.default

이 문제는 도메인이나 위치에서 다른 위치로 사이트를 이동할 때 발생할 수 있습니다.


기본적으로 .htaccess 파일이 있어야하며 httpd.conf가 정확해야합니다.

제 경우에는 섹션에서 /etc/httpd/conf/httpd.conf 파일을 변경했습니다.

<Directory "/var/www/html">

변경된 줄은 다음과 같습니다.

AllowOverride None

AllowOverride All

그리고 웹 서버를 다시 시작하십시오.


기본 동작 ( example.com/?p=42)이 작동하는 경우 다음을 수행해야합니다.

  • 선호하는 영구 링크 스타일로 변경하고 Admin: Settings > Permalinks저장을 클릭합니다. 때때로 문제를 해결합니다. 그렇지 않은 경우 :
  • 파일 /path/to/wordpress/.htaccess이 변경되었고 이제 RewriteEngine On. 줄이 포함되어 있지 않으면 Wordpress 권한 문제입니다.
  • 'rewrite'모듈이로드되었는지 확인합니다. 다음을 사용하여 PHP 파일을 만듭니다.

    <?php
      phpinfo()
    ?>
    

    그 안에 브라우저에서 열고 mod_rewrite. '로드 된 모듈'섹션에 있어야합니다. 그렇지 않은 경우 활성화하십시오- index.html자세한 내용 은 아파치 기본 파일을 확인하십시오-Ubuntu에서 도우미를 사용하여 수행하십시오 a2enmod.

  • 아파치 서버가 .htaccess파일을 보고 있는지 확인하십시오 . 공개 httpd.conf- 또는 우분투의 대안입니다, /etc/apache2/apache2.conf. 그 안에는 다음과 같은 것이 있어야합니다.

    <Directory /path/to/wordpress>
      Options Indexes FollowSymLinks
      AllowOverride All
      Require all granted
    </Directory>
    
  • 이러한 변경을 한 후에는 아파치 서버를 다시 시작하는 것을 잊지 마십시오. sudo service apache2 restart


이 모든 것이 작동하지 않고 .htaccess가 정확하고 영구 링크 트릭이 작동하지 않으면 apache2 rewite mod를 활성화하지 않았을 수 있습니다 .

나는 이것을 실행하고 내 문제가 해결되었습니다.

 sudo a2enmod rewrite 

WordPress 관리 인터페이스 내에서 다음을 수행하십시오.

  1. 관리자 설정으로 이동

  2. 퍼머 링크를 클릭하고 라디오 버튼에서 게시물 이름을 선택합니다.

  3. 아래로 스크롤하면 .htaccess여기에 다음과 같은 코드 가 표시됩니다 .

    <IfModule mod_rewrite.c>
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /wordpress/index.php [L]
    </IfModule> 
    
  4. 코드를 복사하여 .htaccess파일에 붙여 넣습니다 .

이 오류는 아파치 httpd.conf 문서에서 다시 쓰기 모드가 비활성화되어 발생합니다. 주석을 제거하고 서구 친화적 인 영구 링크를 즐기십시오.


  • Check that the directory on .htaccess are the correct
  • Check the fields "siteurl" and "home" are the correct

If you have FTP access to your account:

First, login to your wp-admin and go to Settings > Permalinks

You should see something at the bottom that says:

"If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all."

If this is true do the following:

  1. Go into preferences for your FTP client and make sure hidden files are displayed (varies depending on your FTP client) - If you don't do this you won't be able to find your htaccess file

  2. Go to the folder that your wp-admin, wp-content, wp-includes directories are located. Check for .htaccess file. If it exists skip to step 4

  3. If it does not exist, create a new blank file in your FTP program called .htaccess

  4. Change the CHMOD for your .htaccess file to 666 (your preference on how you want to do this)

  5. Go back to your Permalinks page and edit the link structure you want. Problem should be solved!

  6. Make sure to change the chmod of the htaccess file back to 644 after you are done.

Just had the same problem and it seemed to fix it instantly! Good luck!


Most of the time this issue is fixed by simply visiting the Settings -> Permalink page in the WordPress admin and click Save (as several other answers already pointed out). When this page is accessed, WordPress rewrites the directives in the .htaccess file which magically fixes the issue. The issue often happens after moving a site (the site breaks because the .htaccess gets left behind or the settings need to be updated).

If WordPress doesn't have the right permissions to write the .htaccess file, a notice will appear at the top of the page and further instructions at the bottom when the settings are saved. In this case you need to edit the .htaccess file yourself or, better, to fix the permissions on that file. The file is at the root of the WordPress installation. cd into the directory and sudo chmod 644 .htaccess. You might also want to check if the file belongs to the right group and change that is needed with chown. Ask your hosting provider if you don't know how to do that.

If you are on shared hosting that's probably all you can do. If you still have the issue you might want to talk to you hosting provider's support. Otherwise, make sure the use of .htaccess files is enabled on the server, as @georgeos already suggested. Note that httpd.conf is not always used (Ubuntu indicates it is deprecated but the official Apache docs still says it is often the main configuration file). /etc/httpd/conf/httpd.conf and /etc/apache2/apache2.conf seem to be the most common places for this file. Find the block for the public folder, usually <Directory /var/www/> and make sure that the AllowOverride directive is set to All. If it is set to None, your .htaccess file is simply ignored by the server.


We had the same problem and solved it by checking the error.log of our virtual host. We found the following message:

AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : /srv/www/htdocs/wp-intranet/

The solution was to set Options All and AllowOverride All in our virtual host config.


I installed mod_rewrite to fix the issue. Below link provides an installation guide:- http://www.iasptk.com/enable-apache-mod_rewrite-ubuntu-14-04-lts/


You may have .htaccess disallowed in webhost settings. Setting to default permalinks would work in that case.


I have the same problem and so I remove the Apache and make it again and the problem was solved.


Just Navigate to Settings->Permalink in your dashboard and then Save Changes button in the last.\


Case 1:- Let us think if migrate site from one hosting to another hosting if see this kind of issue.

Solution:- Simply go to old server copy .htaccess file code, then past in new server .htaccess file. 99% it i will works.


If your WordPress installation is in a subfolder (ex. https://www.example.com/subfolder) change this line in your WordPress .htaccess

RewriteRule . /index.php [L]

to

RewriteRule . /subfolder/index.php [L]

By doing so, you are telling the server to look for WordPress index.php in the WordPress folder (ex. https://www.example.com/subfolder) rather than in the public folder (ex. https://www.example.com).


I just changed the permalink to 'month and day'of all the posts by ging to setting>permalink.

Now all posts are open and working fine.

Again, I renamed to all posts to its actual permalink. Its again working fine.

This method worked for me :-)


For nginx users

Use the following in your conf file for your site (usually /etc/nginx/sites-available/example.com)

location / { try_files $uri $uri/ /index.php?q=$uri&$args; }

This hands off all permalink requests to index.php with a URI string and supplied arguments. Do a systemctl reload nginx to see the changes and your non-homepage links should load.


Before trying to do any permalink or server config changes, please check you .htaccess file. This mostly is a corrupt or blank .htaccess file issue. Reset the htaccess file to the default

# 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

I had this issue not so long ago. I had reset my permalink to default or just saved it, updated themes/core to (4.7.4)/plugins, deactivated all plugins, switched to default theme, optimized database, .htaccess is already default, checked file permissions, mod_rewrite is on.

So far nothing works, what works are the posts, new page, the /contact page EXCEPT for old pages.

Basically, the pages/URLs that aren't working are:

/breeding
/training
/training/*
/breeding/*

Ultimate, I found these files in the root folder:

/breeding.php and /training.php

I renamed both files and the pages above worked.

참고URL : https://stackoverflow.com/questions/5182534/wordpress-is-giving-me-404-page-not-found-for-all-pages-except-the-homepage

반응형