programing

404 not found (404를 찾을 수 없습니다).이 서버에서 요청된 URL <>을(를) wordpress로 찾을 수 없습니다.

fastcode 2023. 3. 31. 22:55
반응형

404 not found (404를 찾을 수 없습니다).이 서버에서 요청된 URL <>을(를) wordpress로 찾을없습니다.

최근에 워드프레스를 설치했는데 permalinks 형식을 변경하려고 하면 문제가 발생합니다.

permalink를 디폴트에서 요일 및 시각으로 변경하는 경우

 Default    http://127.0.0.1/?p=123
 Day and name   http://127.0.0.1/2015/03/16/sample-post/ 

생성된 링크는 동작하지 않습니다.동일합니다.error 404항상,

 The requested URL /2015/03/16/post-5-problem/ was not found on this server.

단, permalink 타입이 디폴트일 때는 이것이 완벽하게 동작합니다.

저는 몇 가지 해결책을 찾았습니다.

sudo a2enmod rewrite

Module rewrite already enabled

또 다른 해결책은 permalink를 기본값에서 다른 유형으로 변경하기 전에 .htaccess 파일의 모드 권한을 666으로 변경하는 것입니다.

sudo chmod 666 /address_of_.htaccess 

.htaccess 파일을 확인했습니다.

# 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

그러나 위는 맞는 것 같다, 위는 워드프레스 자체에 포함되어 있다.

두 솔루션 모두 효과가 없는 것 같습니다.permalink 옵션을 활성화하기 위해 변경해야 할 다른 사항이 있습니까?

웹 서버를 새로 설치하는 경우 기본적으로 .htaccess 규칙이 허용되지 않을 수 있습니다.이 문제를 해결하려면 httpd.conf(통상은 /etc/apache2에 있습니다)를 편집하여

<Directory "path/to/your/document/root">    
    # ....

     AllowOverride None

    # ....

</Directory>

및 변경

AllowOverride None

로.

AllowOverride All

그런 다음 웹 서버를 다시 시작하고 다시 시도하십시오.

wordpress 관리 영역에서 원하는 permalink를 리셋하고 htaccess에 다음 코드를 추가합니다.

# BEGIN WordPress

<IfModule mod_rewrite.c>
ErrorDocument 404 /index.php?error=404
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

이제 블로그 투고와 페이지를 확인해 보세요.

감사해요.

[ Preferences ]- > [ Services & Ports ]으로 이동하여 Apache에서 유효한SSL을 체크해야 합니다.

나한텐 효과가 있다

웹 서버가 파일을 찾을 수 없고 Wordpress에 요청을 전달하지 않기 때문에 이 오류가 발생합니다.

Wordpress에 대해 다시 쓰기 규칙을 추가해야 하며, 이 규칙은 웹 서버 소프트웨어(Apache, nginx 등)에 따라 달라집니다.

nginx의 예:

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

즉, 파일 시스템에서 "/2015/03/16/post-5-problem/"을 먼저 열어보십시오.이것이 존재하지 않으면 슬래시를 추가해도 요청을 인수와 함께 index.php(Wordpress 메인 파일)에 전달할 수 없습니다.

리라이트 모듈을 이노블로 하는 것만으로는 불충분합니다.리라이트 규칙을 추가해야 합니다.

언급URL : https://stackoverflow.com/questions/29074376/404-not-found-the-requested-url-url-name-not-found-on-this-server-in-wordp

반응형