本帖最后由 hardrock 于 2014-11-6 23:20 编辑 $ ]6 a7 q2 ^( u; T
2 k1 s# N: G. r. ^$ \# P wampserver2.2e版-32bits不支持固定链接(伪静态)。2 q2 z! L/ _) Y. s4 Y( ^: }9 Q
Wampserver2.4版-32bits支持固定链接(伪静态)吗?
. `# ^( M* j; }, M" s) Z
3 }8 \& i5 X) T& {( C 两个都支持,
; N: [, P, s2 Y- U- ` http://www.thegrouplet.com/forum.php?mod=viewthread&tid=112908
( a% e/ }# X5 o: S http://www.wpdaxue.com/wampserver.html
: z( `+ V4 `" a& m" A0 U) m B2 H8 s http://www.wpdaxue.com/wordpress-change-hosting.html
) V1 F# n: n6 x7 T- K& X( |- |' j http://www.wpdaxue.com/basic-skills-of-creating-themes.html
! _1 P. P G& p2 s7 @/ S% G WampServer 配置伪静态(固定链接),
- E$ \2 s) Z$ k, d 安装后建议开启Apache的 mod_rewrite模块,; r! g1 N" E' w1 Z o; U4 P$ v
要不然设置静态化的网页打不开提示404错误2 g: Y. T" v! ?0 D1 W; e2 J% ?5 B$ z
默认情况下,WampServer不支持伪静态,我们需要进行一些配置. Z. p5 g4 L# o& `' ]
1.启动wampserver服务,左键单击右下角wampserver图标,打开Apache菜单下“httpd.conf”文件;
6 W/ a$ S" f$ R8 b+ ?3 ~' i 2.搜索找到“LoadModule rewrite_module modules/mod_rewrite.so”这一行,去掉前面的“#”;
) Y8 N' u$ l; f& y! L 3.找到“AllowOverride None”改为“AllowOverride All”;) l5 w/ `( L& s, v8 M- v
4.重启wampserver的所有服务4 m" I1 z. p: f) C" \
5.新建.htaccess文件,放在当前网站根目录下,\wamp\www\.htaccess , 在.htaccess文件中添加伪静态规则,比如添加WordPress伪静态规则:
; x# b i* h5 h6 } q6 B1 w Apache伪静态规则
% d) `9 Y9 `0 ?, K$ ~ # BEGIN WordPress. o' f0 }5 X: ]. B# H. Q
<IfModule mod_rewrite.c>3 N7 K) x+ I. k: Y
RewriteEngine On" D: v* \* _4 K4 t. w+ m
RewriteBase /
7 R1 e3 @9 K4 H9 X% L RewriteRule ^index\.php$ - [L]
9 h+ a0 l( I9 d/ F5 { RewriteCond %{REQUEST_FILENAME} !-f
% P( p+ ^1 r$ c# f$ P5 C RewriteCond %{REQUEST_FILENAME} !-d
, U: E' D% `6 }6 v RewriteRule . /index.php [L]8 `& }+ S/ v* e. v8 [& V1 _0 u/ T
</IfModule>4 q- A8 W4 q, H/ w! E
# END WordPress 复制代码 注:每个建站程序的伪静态规则不一样,请根据自己的需要添加。
, x1 Q; g7 Y3 ?2 G7 x$ P 如果wp文件放在目录a下,.htaccess要放在目录a下,\wamp\www\a\.htaccess
# ^7 ]2 t5 K! b# {6 m$ I* [6 _" `+ M. [ # BEGIN WordPress5 x( V% j9 O4 }, y! }% _) Y2 S
<IfModule mod_rewrite.c>' f& T9 T* J+ l! {5 t/ A$ f
RewriteEngine On h6 N+ l n E8 K; O
RewriteBase /a/
8 Q S" _( C/ h% u* y6 ` RewriteRule ^index\.php$ - [L]
6 J' X4 g: W" `9 ] RewriteCond %{REQUEST_FILENAME} !-f
8 _ F( q4 ~0 U* N: Q RewriteCond %{REQUEST_FILENAME} !-d5 L: F4 n- Q9 p4 n4 M
RewriteRule . /a/index.php [L]
6 x( s6 B. `$ s* m$ } </IfModule>- W& Q$ r# l. I
# END WordPress 复制代码
; M- w. u' j2 \) ^. W1 h' P 访问就用 http://localhost/a/ ,
! u2 W4 `9 G" \9 Q1 C3 P5 K5 `& X9 R; L wp后台----WordPress地址(URL)----站点地址(URL), 要改成 http://localhost/a/' z% A2 K i0 r$ w: |2 ^
& V" Z# y" x! y' E9 c9 I$ r
" o8 Y" r k/ C php.ini部分; p- X( ?3 }# g& j
memory_limit =128M
) `. u" l# i/ ~4 w f post_max_size = 8M: c& W+ `$ Y* g, Y9 k5 S
upload_max_filesize = 2M! u% v6 S" F: K4 k% p- ~' a: k
3 z* s$ _/ ~- M& k9 ~* ] [8 g0 p
php环境下无法上传大文件的解决方法 http://www.ppsmove.com/stationtec/4862.html
- R! G7 x$ H! d
+ p! U+ { c' Z0 Q& G
- L$ u4 o* A' v+ a5 p$ a. g 2 o) B1 t& E) u# k( T F& m
http://www.solagirl.net/how-to-migrate-wordpress-from-local-computer-to-server.html http://www.solagirl.net/wp-migrate-db.html http://www.wpdaxue.com/wp-migrate-db.html
0 w1 W" W/ g( M9 C/ F6 k& [! x. Z WP Migrate DB 数据库迁移插件 在本地测试站安装,在导出数据库前更改数据库网址和文件路径等,然后导出数据库。网站移植到空间后,然后在 phpMyAdmin 导入刚才导出的数据库文件即可。站点数据等更改完成后就可以卸载这插件了
; D& @6 b' R/ D3 x6 q7 n
, t7 t. i h/ d; {& S$ c( p: L! A ( R4 d5 k7 Z, s- Y# x
\: s9 R2 T8 x9 B- z7 L8 k ( [2 P9 @8 K* V6 h: n
Pretty Link http://www.wpdaxue.com/pretty-link.html 9 E+ n( F9 m1 u+ t5 g8 P A0 Q
在WordPress后台“安装插件”中直接搜索Pretty Link,搜索结果中是Pretty Link Lite,也就是Pretty Link的简易免费版本
% s" \' ?9 p* g7 G2 [ ^ 2 |; D! l) T* q l8 u; D
8 s2 K" _# I3 F1 V1 T3 T
( n" k0 d. h& ?% g' U- h8 S& j How To Move Your WordPress Website From localhost To Live Server
+ {3 G% ^3 k% y" }1 v http://www.wpexplorer.com/wordpress-local-to-live/
1 W7 |$ q& Q: F
9 G/ y0 P4 R% Y- b
相关帖子