
標題: [CPG] 精簡網址 [打印本頁]
作者: segaa 時間: 2006-7-30 01:42 PM 標題: [CPG] 精簡網址
基本上就是讓: J; U$ o4 t, F9 p% e
# ]# C$ [# g- r6 x" A B2 Y
http://pic.segaa.net/segaa" U9 j5 B" _, d# s8 `" H
0 @3 L% t% |: V% ?! \2 e2 O自動相通於6 @# E6 X, [; U H" H2 ?
6 K& c+ @: {9 Fhttp://pic.segaa.net/index.php?cat=10002* N7 \+ I; }3 P$ n3 ]$ e3 k& ^- u; Q
6 ~7 g, ?- l+ A; ?/ n
讓使用者簡單的記住自己相簿的網址
& F2 a: L9 D. V: f( V
8 t$ V. ^& r, e
編輯index.php 加入以下這些
. ^/ ~( q6 T, s4 ]& @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
作者: segaa 時間: 2006-7-31 10:56 PM
進階的精簡網址 ... 基本上直接開啟外掛就好了 
* y! w) I2 v1 N9 R) m* J( h: ~* W, c
! ~7 e5 Z8 _: A6 K! D$ @) q: m
1. 登入管理者之後 -> 設定 -> 允許外掛 點 是 -> 確認
3 D2 F# s% j) D
; E" S( v$ I& g; d [2. 設定 -> ( 外掛管理 ) -> 名稱 Search Engine Friendly URLs v1.0 -> 旁邊有一個 i 的圖形點下去
2 ?& p* I7 q1 X2 G$ A3 i 選擇覆蓋掉原本的 .htaccess 檔
E) g, c- j9 _& u! z
" {6 Q3 R; C( v' m6 X: B3. 但是這樣作會讓之前的 http://pic.segaa.net/segaa 失效 , 所以再把上篇的內容加回去
) M2 G* | t( H! J
# R' V4 y0 r0 v8 C; I) b8 C* J$ l- s下面是我目前的 .htaccess 檔 & Z4 G8 ~, Z% v. q1 }
+ J. M* k- Z; }% T0 b/ a1 R0 X
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
作者: prolog 時間: 2006-11-21 02:46 PM
其實關於精簡網址
6 o) P. y, u8 P& V# h' N" S這邊站長的教學寫的很清楚了" y9 Z1 f' n0 M: A6 H% j9 J
謝謝% |1 T1 C* t* _7 ]- z! v/ b/ x; r, N& ?
! O7 `9 C# Q+ J/ p) w, h+ \. _
但是我照做之後
9 w7 p. l5 X" u: D6 i$ T不能連入相簿了
! t j: d: \; h; k- a他告訴我這行有誤
# P* \7 ?6 F6 E" i$sql = "SELECT user_id from `cpg134_users` WHERE `user_name` = "$qq"";
& y5 V2 n! [! K" B! G+ G* O& v(上面的cpg134_users我改成cpg1410_users)4 H0 G, Z# C1 N1 J8 u
0 w5 t6 ?' F& `1 n請問一下我該如何解決?
% m3 n) x7 A, [. ?# @1 W: w謝謝
作者: segaa 時間: 2006-12-10 10:05 AM
sorry 太少上論壇看東西了 
& e8 l" a- y+ Q8 s0 w這邊原本是我用來丟些文件用的
$ x1 N( ?$ t& @# L) J: H關於這個問題,可能你要直接進資料庫,看你資料庫中所使用的欄位名稱
! Q0 |: K+ P( ^* z2 h8 B% `# h# I+ c, f8 {2 l, l$ L
7 S9 J3 V5 j. r2 n$ _& w引用:
原帖由 prolog 於 2006-11-21 02:46 PM 發表' a4 ]8 v: v; U/ L3 C. E9 R9 Q) }
其實關於精簡網址2 K! J( a. d$ Y- k1 T' t
這邊站長的教學寫的很清楚了
8 y- o9 E' n$ m3 _5 P謝謝
/ s! j0 R# |/ s5 ^
$ J: _8 n! ?$ l) U( _) {但是我照做之後
. y+ ]2 S( I7 c g% w5 y不能連入相簿了' V4 h3 q! j% l; l7 f/ H2 i, {6 {- }
他告訴我這行有誤& l# g* S, w' X) Z/ R
$sql = "SELECT user_id from `cpg134_users` ...
作者: xzig2thao 時間: 2010-3-10 12:10 AM 標題: Ragnarok Online usrmt power leveling
顶) N5 o: _$ w6 ?3 U3 ~3 t% f' O1 J
说的太对了,赞同的赞同!!: K7 n6 |1 }4 G: P0 y
Ragnarok power leveling
: x8 a) K5 ~/ ] V- g2 U* Qro power leveling5 |' e: ]9 S8 O" R
Ragnarok Online power leveling
9 [' \( ?5 t6 s' y+ T9 O! Z+ @# c有事者,事竟成;
9 P0 x& {. o% J- Z& F3 f5 T破釜沉舟,百二秦关终归楚;! B/ z7 B% T* J# b0 l
苦心人,天不负;
0 s0 \ O n- c; u4 }卧薪尝胆,三千越甲可吞吴。
作者: fack10 時間: 2010-3-13 12:56 PM 標題: 支持!
支持!7 @2 a, z& q; g- L1 x
, z$ v ~7 C9 G# e! n ]
# r N$ a5 C5 S( l( L% w B7 r% {) [9 f
; Y/ h q. K5 n& E( h6 k8 M0 r [: R3 b
0 y9 x0 W" X3 i$ w1 s& {2 S
* y6 s1 D! c% K+ k; n3 t+ U$ H
# f* y# ]7 E5 Y2 W" v- _
4 c- J$ q7 M, p
; h7 ]% o# M9 y6 E: i* c- @
% F7 }; ?- S: b" r5 a( m5 h) Z6 q4 Y! Y
' M" L! l6 `2 i# a- G* z. c
! t* v$ r, Y7 B" l' J- Z高温合金管 12cr1mov合金管 不锈钢无缝管 大口径无缝管 高压合金管
作者: fack10 時間: 2010-4-23 11:44 PM 標題: 支持!
支持!
+ f8 F$ E4 f$ n- [1 r' m7 G& {" C% R3 i" t+ m( N
/ t! H' G1 ~; O% {( r2 P3 A( `* @
; L% q/ c: Y" s" `9 O% O& i0 A: O8 Z, E
* R1 Y/ Z, c% D2 \: i! \* m) h$ r: K) t8 Q
( H; f( x' n- n. J" ]
" o$ I/ l6 P7 D S5 f: l
0 Z% U o% l" o: t. }+ I9 q
" A- Y$ M+ T4 P/ C3 S- W' i. O* ^ ~
9 g5 H, v1 @. R: q2 O+ {
% T% _9 B' h7 o! E4 t
A333GR3无缝钢管 无缝方矩管 S355无缝方管 热轧无缝方管 无缝方管
| 歡迎光臨 幸運草之戀 (http://discuz.segaa.net/) |
Powered by Discuz! 6.0.0 |