Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
LemonWiki共筆
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Beautifying URLs of MediaWiki
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
<< [[MediaWikiInstallRecord|MediaWiki 安裝紀錄]] == 目的: 改成 /wiki/ 式網址 == {{Software version| software=MediaWiki | url=http://www.mediawiki.org/wiki/MediaWiki | version=1.10.0 }} 目的: 網址從/mediawiki/index.php/ 改成 /wiki/ 式網址,進而縮短網址 ; 修改方式 * 修改LocalSettings.php $wgArticlePath = "/wiki/$1"; * 修改apache/conf/httpd.conf <pre> Alias /wiki C:/xampplite/htdocs/mediawiki/index.php Alias /index.php C:/xampplite/htdocs/mediawiki/index.php </pre> 重新啟動 apache 服務 詳細參考資料 * [http://www.mediawiki.org/wiki/Manual:Short_URL Manual:Short URL - MediaWiki] == 目的: 將網址的 問號 改為 / == 目的: 美化MediaWiki的網址。網址由http://en.wikipedia.org/w/index.php?title=Republic_Day 改為 http://en.wikipedia.org/wiki/Republic_Day === 修改方式 === ==== 修改LocalSettings.php ==== * 安裝MediaWiki至 http://www.yourdomain.com/w 而非 http://www.yourdomain.com/ 或 http://www.yourdomain.com/wiki * 完成安裝之後,修改 LocalSettings.php $wgScriptPath = "/w"; $wgArticlePath = "/wiki/$1"; ==== 修改 .htaccess ==== * 增加 .htaccess 至 http://www.yourdomain.com/ 的根目錄 <pre> RewriteEngine on # do the rewrite RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA] </pre> 參考: * [http://wiki.dreamhost.com/index.php/MediaWiki MediaWiki - DreamHost] - 列出多種美化網址的方法 (last visited: April 5, 2006) * [http://pesty.yichi.org/blog/2005/12/18/mediawiki_and_pretty_url/ Pesty’s Articles » 如何讓 MediaWiki 可以使用漂亮的網址] (last visited: April 5, 2006) === 適用環境 === * 伺服器軟體: Apache/1.3.33 (Unix) + Apache Rewrite Engine * [http://www.mediawiki.org/ MediaWiki]: 1.5.6 [[Category:MediaWiki]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki共筆:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:Software version
(
edit
)