進階的精簡網址 ... 基本上直接開啟外掛就好了
) T9 a+ z! ^9 h' e: }
' {4 g5 l( Q+ ~' u8 Z. y3 g9 P9 C, m- c
& L+ s" d- f2 t1. 登入管理者之後 -> 設定 -> 允許外掛 點 是 -> 確認
" y" q3 L! `5 g$ Z7 z* Z
- ]3 ] q7 V1 n$ k9 n2. 設定 -> ( 外掛管理 ) -> 名稱 Search Engine Friendly URLs v1.0 -> 旁邊有一個 i 的圖形點下去
. i6 [1 C. j* T 選擇覆蓋掉原本的 .htaccess 檔
* L0 A u6 D9 k2 I$ P* V. D0 |3 i; s4 r
/ T8 x: ]. C( P/ Z! x& a4 ]1 u3. 但是這樣作會讓之前的 http://pic.segaa.net/segaa 失效 , 所以再把上篇的內容加回去
5 |5 y( R3 Y% t# i9 ^$ f) `
7 P, Q) \1 t) A6 p! |; W下面是我目前的 .htaccess 檔
: L) O7 z7 b9 K" t. q
; f- v9 L8 ~- ~, c* X/ p. Q
ps.我將 displayimage.php 改成 display.php thumbnails.php 改成 thumb.php
複製內容到剪貼板
代碼:
<Files .htaccess>
deny from all
</Files>
Options FollowSymLinks SymLinksIfOwnerMatch
RewriteEngine on
RewriteEngine On
RewriteBase /
RewriteRule ^([A-Za-z_0-9-]+)/*$ /?$1 [L]
RewriteRule ^user-([0-9a-zA-Z]+)$ /index.php?cat=$1
RewriteRule ^user/([0-9a-zA-Z]+)$ /index.php?cat=$1
RewriteRule ^user/$ /index.php
# Uncomment the following line if your webserver's
# URL is not directly related to physical file paths.
# Update "YOUR_COPPERMINE_ROOT" (just / for root)
#RewriteBase /YOUR_COPPERMINE_ROOT
#
# Rewrite index urls
#
RewriteRule index-([0-9]*)\.html index.php?cat=$1 [NC]
RewriteRule index-([0-9]*)-page-([0-9]*)\.html index.php?cat=$1&page=$2 [NC]
#
# Rewrite thumbnail urls
#
RewriteRule thumbnails-([a-z0-9]*)-([\-]?[0-9]*)\.html thumbnails.php?album=$1&cat=$2 [NC]
RewriteRule thumbnails-([a-z0-9]*)-page-([0-9]*)\.html thumbnails.php?album=$1&page=$2 [NC]
RewriteRule thumbnails-([a-z0-9]*)-([\-]?[0-9]*)-page-([0-9]*)\.html thumbnails.php?album=$1&cat=$2&page=$3 [NC]
RewriteRule thumbnails-([0-9]*)\.html thumbnails.php?album=$1 [NC]
RewriteRule thumb-search-(.*)\.html thumb.php?album=search&search=$1 [NC]
#
# Rewrite displayimage urls
#
RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html displayimage.php?album=$1&cat=$2&pos=$3 [NC]
RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)\.html displayimage.php?album=$1&pos=$2 [NC]
RewriteRule displayimage-([0-9]+)\.html displayimage.php?pos=-$1 [NC]
RewriteRule slideshow-([0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html displayimage.php?album=$1&pid=$2&slideshow=$3 [NC]
RewriteRule slideshow-([a-z]+)-([\-]?[0-9]+)-([0-9]+)-([0-9]+)\.html displayimage.php?album=$1&cat=$2&pid=$3&slideshow
=$4 [NC]
RewriteRule display-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html display.php?album=$1&cat=$2&pos=$3 [NC]
RewriteRule display-([a-z0-9]+)-([\-]?[0-9]+)\.html display.php?album=$1&pos=$2 [NC]
RewriteRule display-([0-9]+)\.html display.php?pos=-$1 [NC]
RewriteRule slideshow-([0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html display.php?album=$1&pid=$2&slideshow=$3 [NC]
RewriteRule slideshow-([a-z]+)-([\-]?[0-9]+)-([0-9]+)-([0-9]+)\.html display.php?album=$1&cat=$2&pid=$3&slideshow=$4 [
NC]
<Files user>
ForceType application/x-httpd-php
</Files>
#ErrorDocument 401 /index.php
#ErrorDocument 403 /index.php
#ErrorDocument 404 /index.php