사이트 등록
보이기
개요
구글 콘솔 서치나 네이버 서치어드바이저 등에 사이트를 등록해야 검색엔진에 노출된다.
구글
구글 서치콘솔.
robots.txt 등록
구글 봇이 크롤링을 할 수 있게 설정.
| 과정 | 설명 | 비고 |
|---|---|---|
| 웹서버 설정 | 루트 디렉토리에 robots.txt를 작성한다. |
|
| robots.txt 작성 | User-agent: *
Disallow: /index.php Disallow: /load.php Disallow: /api.php Disallow: /rest.php Disallow: /mediawiki/ Disallow: /wiki/Special: Allow: /mediawiki/resources/ Allow: /mediawiki/extensions/ Allow: /mediawiki/skins/ Sitemap: https://smwiki.info/sitemap.xml |
sitemap.xml은 설정하기 나름이니... 참고참고. |
사이트맵
- 기본적으로 https://www.mediawiki.org/wiki/Manual:GenerateSitemap.php를 참고.
- 일반적으로 sitemap 디렉토리를 만들고, 버전에 따른 명령어를 작성하는 방식. 위 링크에서 제공하는 명령은 사이트명이 기입되어있지 않아 조정이 필요하다.
| 과정 | 설명 | 비고 |
|---|---|---|
| 디렉토리 제작 |
|
|
| 사이트맵 생성 | php maintenance/run.php generateSitemap \
--memory-limit=50M \ --fspath=/var/www/html/sitemap/ \ --identifier=smwiki.info \ --urlpath=/sitemap/ \ --server=https://smwiki.info \ --compress=yes \ --skip-redirects |
|
| 사이트맵 권한 설정 | 이상하게 계정에 귀속된 파일들이 생성된다. 권한 다시 설정.
|
|
| nginx 설정 | # sitemap.xml 파일 제공(bot의 크롤링을 위해.)
location = /sitemap.xml {
alias /var/www/html/sitemap/sitemap-index-smwiki.info.xml;
allow all;
log_not_found off;
access_log off;
}
|
|
명령이 제대로 기입되면 "https://smwiki.info/sitemap.xml"가 사이트맵 주소가 된다.