위 키 미디어 의사 정적 설정

간단 한 미디어 위 키 페이지 의사 정적 설정:
가장 쉬 운 것 은 LocalSettings.php 에$wgUsePathInfo=true 를 추가 하 는 것 입 니 다.이렇게 기본 연결 은...http://wiki.clin003.com/index.php/첫 페이지'라 는 링크 도 보편적으로 사용 되 고 문제 가 발견 되 지 않 았 다.
사용자 정의 mediawiki 페이지 의사 정적 설정:
연결 모양"http://wiki.clin003.com/wiki/%E9%A6%96%E9%A1%B5"(이것 은 첫 페이지 의 링크 입 니 다.)
설정 방법:
먼저.htaccess 파일 을 만 듭 니 다.내용 은:
\#\#설치 경 로 는 하위 디 렉 터 리 에 있 습 니 다!!
RewriteEngine on RewriteRule index.htm/e/index.php\#여 기 는 루트 디 렉 터 리 에 index.htm 의 빈 파일 RewriteRule wiki/(.+)/e/index.php/$1\#여기 서 해결 하 는 검색 결과 가 없습니다.아래 의 반복 과 혼 란 스 럽 습 니 다.ing RewriteRule wiki/(.+)/e/index.php?title=$1
추천 하 는.htaccess 파일 내용(공식 문서 에서):
PS:이 걸 사용 하면 루트 디 렉 터 리 에 index.htm 빈 파일 을 만 들 필요 가 없습니다.
##http://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_title_–_no_root_access
Options FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wiki/(.*)$ e/index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ wiki/ [L,QSA] RewriteRule ^/*$ wiki/ [L,QSA]
그리고 LocalSettings.php 편집

				$wgScriptPath = “/e”;         # Path to the actual files (right part of first rewrite rule). Should already be there
##mediawiki ( ) ,
##
$wgArticlePath
= “/wiki/$1″; # Virtual path (left part of first rewrite rule). MUST be DIFFERENT from the path above!
## , , ( , )。
mediawiki :http://www.mediawiki.org/wiki/Manual:Short_URL#Defaults


robots.txt
User-agent: *
Disallow: /e/
Disallow: /wiki/Special:Search
Disallow: /wiki/Special:Random
/e/ (mediawiki ), , 。
PS: , .htaccess , , .htaccess o(∩_∩)o…

mediawiki :
from:http://easun.org/archives/wikimedia_wiki_url_short.html
1. :

mv index.php show
mv redirect.php redirect

2. .htaccess

<Files ~ (show|redirect)>
ForceType application/x-httpd-php
</Files>
DirectoryIndex show

3. LocalSettings.php $wgScript,$wgRedirectScript,$wgArticlePath

$wgScript = “$wgScriptPath/show”;
$wgRedirectScript = “$wgScriptPath/redirect”;
$wgArticlePath = “$wgScript/$1″;

mod_rewrite ,

좋은 웹페이지 즐겨찾기