워드프레스를 처음 만들고 접속해보면 주소 뒤에 /wordpress가 있어야 접속이 가능하다.
예를 들면 leeguamanse.tistory/wordpress 이렇게 해야 워드프레스 홈페이지로 접속이 된다.
이 /wordpress 없이 접속을 하려면 root 폴더(헤놀로지, 시놀로지의 경우 web 폴더)의 .htaccess 와 index.php 파일을 수정해줘야한다.
(htaccess 파일 내용. 복붙하면 된다)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?사용자 도메인, ip주소, DDNS등$
RewriteRule ^(/)?$ wordpress [L]
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<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
사용자 도메인 앞 (www.)?은 뭔지 모르겠으나, 도메인 만들때 www.을 붙여서 만들어서 남겨뒀더니 잘 된다.
앞에 /wordpress 지워보겠다고 2틀간 삽질했는데... 코드 3줄이면 되었을줄이야...ㅠㅠ
파일은 wordpress 안에있는 index.php, .htaccess를 복사해서 붙여넣기 했다.
index.php는
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );