打印

[CPG] 精簡網址

[CPG] 精簡網址

基本上就是讓8 f& M% N6 d% C- z3 u1 ]+ W

1 f5 m7 Y% B) w% vhttp://pic.segaa.net/segaa5 Y5 ]) \1 {; }0 ?
5 n) V' t. ~3 r( Y" m
自動相通於/ K, L+ D' A* L# v$ k. d
4 g5 p1 {$ H& r3 [+ _9 y
http://pic.segaa.net/index.php?cat=10002; e/ c' X3 R* R6 j. {" X' O

. ^3 y1 \$ A  O讓使用者簡單的記住自己相簿的網址 9 P0 l1 j  F" |4 W7 T
8 K) o' g/ n, u' i0 x9 |
編輯index.php 加入以下這些$ n+ l8 v2 I3 O! V5 l9 @: ]/ g
cpg134_user <- 這邊請自行修改
複製內容到剪貼板
代碼:
$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
$qq = eregi_replace ( '%20', ' ', $qq);
$qq=mysql_escape_string($qq);
$sql = "SELECT user_id from `cpg134_users` WHERE `user_name` = "$qq"";
$result1 = mysql_query($sql);
if (mysql_num_rows($result1)>0) {
list($uid) = mysql_fetch_array($result1);
$cat = sprintf("1%04d",$uid);
}
mysql_free_result($result1);
}





//
// Main code
//
編輯 .htacess
複製內容到剪貼板
代碼:
<Files .htaccess>
deny from all
</Files>

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
RewriteRule ^my$ /profile.php?op=edit_profile
RewriteRule ^new$ /thumb.php?album=lastup
RewriteRule ^hot$ /thumb.php?album=topn


<Files user>
ForceType application/x-httpd-php
</Files>

#ErrorDocument 401 /index.php
#ErrorDocument 403 /index.php
#ErrorDocument 404 /index.php

TOP

進階的精簡網址 ... 基本上直接開啟外掛就好了 6 [- Z1 N! M/ x/ s, H+ i3 a9 V

' \8 g& }0 v3 G* l) {
% k, ^  `) m; u5 x2 k1. 登入管理者之後 -> 設定 -> 允許外掛  點 是 -> 確認
* c1 P( \% X$ K) y& I
8 X; B8 r. F/ `9 w7 l8 N2. 設定 -> ( 外掛管理 ) -> 名稱 Search Engine Friendly URLs v1.0 -> 旁邊有一個 i 的圖形點下去
' x  J+ }2 O: m    選擇覆蓋掉原本的 .htaccess 檔 8 B# u1 [2 C% a

9 f0 S' @/ P" v, d& w3. 但是這樣作會讓之前的 http://pic.segaa.net/segaa 失效 , 所以再把上篇的內容加回去
1 x' |. @3 y( [$ R2 j( W. T
) K8 j8 w7 w" ]3 t1 }: F# h下面是我目前的 .htaccess 檔 + M. K% U* J- p* H3 W

! d7 M. G4 D( `2 L) O" nps.我將 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

TOP

其實關於精簡網址4 z! O2 H% P$ Q* U- R8 z5 G' u
這邊站長的教學寫的很清楚了. r+ Y! w( {7 ?; R8 c6 o+ f- K9 S- Z
謝謝
+ ]9 O! j8 G  }: j- f/ _. p
" H+ T6 c) C" m4 s但是我照做之後
) E& i1 l* h- K1 d# U/ D) A不能連入相簿了! W1 B( L7 f+ ~! l
他告訴我這行有誤
7 R6 C. {4 m  j4 m0 t" N4 s' }$sql = "SELECT user_id from `cpg134_users` WHERE `user_name` = "$qq"";
- d! n0 a' u4 U+ s(上面的cpg134_users我改成cpg1410_users)
* v  u3 G( ~+ L3 c! B9 h% j' f" v: x) y" P( m) N* o0 D! X
請問一下我該如何解決?
3 O4 ^1 n* J# |8 E  C謝謝

TOP

sorry 太少上論壇看東西了
3 v' J- R  F' [. ]這邊原本是我用來丟些文件用的 . t8 v5 Z. A9 b3 V, \- ~' D4 B
關於這個問題,可能你要直接進資料庫,看你資料庫中所使用的欄位名稱
5 p- W1 V' o9 Q$ V3 H- c4 w
: P  A4 _. j3 i2 l0 e7 t1 O& I
/ F" Z* d0 W4 Y& T
引用:
原帖由 prolog 於 2006-11-21 02:46 PM 發表! q: x) V! H- }$ w5 v% J& z; _+ `
其實關於精簡網址& _4 C1 M/ O5 Q
這邊站長的教學寫的很清楚了
+ I& u# z+ P. E8 e謝謝
: {" p8 m+ k. |2 @3 n! h; |
+ {7 x* b' h4 G; Y$ X% m但是我照做之後
* a! ^$ r- X. T+ l% t不能連入相簿了! m' d' q% u! p9 p$ j4 S
他告訴我這行有誤
/ O- g7 }! E0 R) f7 p+ T# x$sql = "SELECT user_id from `cpg134_users`  ...

TOP

Ragnarok Online usrmt power leveling

) J4 y6 a  y( G/ U$ z
说的太对了,赞同的赞同!!
) z, X" v, L: L9 R, o. aRagnarok power leveling
; R7 d/ z+ ]" N& X4 Sro power leveling: i$ Y. f' x7 ^
Ragnarok Online power leveling, s2 Y( w+ ?4 z, y$ U8 a
有事者,事竟成;
! D2 s! U4 r8 q/ o- C( `( b破釜沉舟,百二秦关终归楚;
% c7 K% q3 ~, [3 E0 \4 s苦心人,天不负;
- m: M& ~2 [) w5 c" `卧薪尝胆,三千越甲可吞吴。

TOP

支持!

支持!
; u) s; x! @/ g/ ]
$ k/ C, p  {/ z8 y0 d' q( W# v# A7 z. V! w! ]0 Y

7 R) V& P) z6 `" O0 D0 K& ]$ O7 W4 N3 T* Z. ~+ z  y
. h# _  ~- G/ |' x) F7 g$ \/ H9 f

( w8 Y) ]2 z& S3 a& _, }; l
9 @2 W6 ^3 n& k! [" w3 B4 \# ?5 g
  W* c: f2 R0 t' w+ T4 y" R0 l; a& ]' r  g& J

# U0 f# X& W6 R+ t. m5 d/ F5 {& J7 x2 v

5 ^4 I% v) J" D: l7 [! p4 ~, b
% x0 n# n8 a% `" V6 J高温合金管 12cr1mov合金管 不锈钢无缝管 大口径无缝管 高压合金管

TOP

支持!

支持!# X) v) F+ q- K* u  c9 l+ `
" V% `4 J' ^! Y# }$ O4 T# s1 Q

0 b, k, ^1 V8 w" n  u
; n3 n8 b0 C4 U' Q5 m7 _$ {  m9 Q+ N) ~' w. M" ]$ s6 l3 z+ q. m

8 `) ?# c% d6 b' W7 ]  G+ O% P1 K2 ?3 G$ [! @0 N

- c/ W+ s  e! O2 g" e  t
+ i$ B9 R1 J& Z6 P% w2 c7 y: D3 S! E$ c; f4 s0 O: _+ Y

" @& g4 I" J! g% [
& U! u8 D5 l$ J- k- J$ F: ], R
8 ^8 G( c6 x- `( s" s2 @
7 {1 J# x5 r) i1 [A333GR3无缝钢管 无缝方矩管 S355无缝方管 热轧无缝方管 无缝方管

TOP

發新話題