|
|
本帖最后由 hardrock 于 2014-11-6 23:20 编辑
- H0 Y7 ^: D9 g- l$ s* T8 H: d( d: w% M
wampserver2.2e版-32bits不支持固定链接(伪静态)。! h- b; {/ n* e+ w5 N
Wampserver2.4版-32bits支持固定链接(伪静态)吗?
4 P2 y% N0 K9 V" ^" n& `: t( @/ q& t4 f; Q
两个都支持,: P! U0 m9 C4 u( I
http://www.thegrouplet.com/forum.php?mod=viewthread&tid=112908% k+ U8 u0 e* g, w2 D; p
http://www.wpdaxue.com/wampserver.html: l! Y) F5 O' g# e" L; ^. Z/ T
http://www.wpdaxue.com/wordpress-change-hosting.html
$ }6 G! z6 L; v# S$ p9 Shttp://www.wpdaxue.com/basic-skills-of-creating-themes.html
" T0 t' ~/ t o- \$ I/ Y) tWampServer 配置伪静态(固定链接),
J& O: u4 U+ Y) ]" I安装后建议开启Apache的 mod_rewrite模块,
0 D% }. E3 u4 F% _" w要不然设置静态化的网页打不开提示404错误
1 T9 z6 U2 c: h% `" b默认情况下,WampServer不支持伪静态,我们需要进行一些配置( B2 w( t! I C' u- z @
1.启动wampserver服务,左键单击右下角wampserver图标,打开Apache菜单下“httpd.conf”文件;
9 J0 I7 Y$ X5 Q* R, D8 X+ Q. Z6 Y) i- T2.搜索找到“LoadModule rewrite_module modules/mod_rewrite.so”这一行,去掉前面的“#”;9 _! W- S* W" R! K
3.找到“AllowOverride None”改为“AllowOverride All”; D+ j- @6 t# R7 x5 U% n
4.重启wampserver的所有服务
$ M2 J s% a; j3 W5 U i1 M5.新建.htaccess文件,放在当前网站根目录下,\wamp\www\.htaccess , 在.htaccess文件中添加伪静态规则,比如添加WordPress伪静态规则:
& \2 k$ J* E4 x3 NApache伪静态规则, k1 A! \, }7 U9 D0 K
- # BEGIN WordPress0 q2 a# f+ `! P& B/ u$ [1 n
- <IfModule mod_rewrite.c>7 e) ^; \2 D8 H- m4 `
- RewriteEngine On7 v, v. E _+ h& P3 V: _
- RewriteBase /% R7 j7 U$ R5 p: V
- RewriteRule ^index\.php$ - [L]
+ X) _- P, F8 q, ]# z - RewriteCond %{REQUEST_FILENAME} !-f# R; H$ O' \6 p4 a, v9 b) g
- RewriteCond %{REQUEST_FILENAME} !-d
& c9 @9 j! `$ U7 s; t+ k9 D2 z2 Y - RewriteRule . /index.php [L]3 W! h9 ~+ U" b) A7 X+ {3 l
- </IfModule>* G& M1 Y* _3 h
- # END WordPress
复制代码 注:每个建站程序的伪静态规则不一样,请根据自己的需要添加。
' C/ W8 I& o, p& [! f6 H: X3 ~如果wp文件放在目录a下,.htaccess要放在目录a下,\wamp\www\a\.htaccess
* V3 _8 x4 ~1 M/ n5 m. X$ D* Q0 D- # BEGIN WordPress. A2 ~( J$ o: ] X9 m6 a, i
- <IfModule mod_rewrite.c>
# f- G+ e1 [6 V5 S; @ - RewriteEngine On
w' F2 ?, t- @2 V) Y+ Y) L$ | - RewriteBase /a/- Q& u) b5 B: g; a! \6 W
- RewriteRule ^index\.php$ - [L]
3 r( |" ]" ?# {9 ]! C( F* n9 ^ - RewriteCond %{REQUEST_FILENAME} !-f
5 \# u& V' _; z - RewriteCond %{REQUEST_FILENAME} !-d ?1 I6 ^! N- m! a; f: m1 \
- RewriteRule . /a/index.php [L]
/ a6 U# o- N0 G9 t- { - </IfModule>
# L# h: b! k M1 H w - # END WordPress
复制代码
4 x: {4 m+ J0 K" X- q( X3 i访问就用 http://localhost/a/ ,; G( w; |% s# D+ o$ C+ w3 I" W z
wp后台----WordPress地址(URL)----站点地址(URL), 要改成 http://localhost/a/
% N5 P7 @; V. Q
6 f& |5 r( v; t! }( G% h2 P$ H( D, n' W4 p
php.ini部分
* H+ {8 {, b" {memory_limit =128M+ K+ z6 e W3 y
post_max_size = 8M
9 p4 @( k/ j0 Bupload_max_filesize = 2M) H' l9 U' z9 q; A
; _( a" C6 L, h! p3 @4 B
php环境下无法上传大文件的解决方法 http://www.ppsmove.com/stationtec/4862.html' V# M- D/ t9 G. E5 @
3 M5 w8 j4 g$ n
4 a% x: F$ ~# q. g* A M t0 O
9 l9 I5 {* g8 r! @4 D! H& _0 ^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/ [' M5 J6 h1 F/ [
WP Migrate DB 数据库迁移插件 在本地测试站安装,在导出数据库前更改数据库网址和文件路径等,然后导出数据库。网站移植到空间后,然后在 phpMyAdmin 导入刚才导出的数据库文件即可。站点数据等更改完成后就可以卸载这插件了
/ k4 U3 x. q+ i1 a( s
3 M" Z7 f8 s6 `% i4 @' e' b, B' U. u5 C; p
* a) O, S* A, l
( P& _( c! y! Q" C
Pretty Link http://www.wpdaxue.com/pretty-link.html% z# c# `" r% \' {2 D$ q. b! n
在WordPress后台“安装插件”中直接搜索Pretty Link,搜索结果中是Pretty Link Lite,也就是Pretty Link的简易免费版本
Z" `2 f- ^9 e" }( |( o1 \6 ?. D3 y) P/ F% B9 M
7 g% ~8 G$ K: c0 m3 h# l& f& F+ @: W q; y6 g
How To Move Your WordPress Website From localhost To Live Server5 z+ V( c" A5 T2 i7 \. i1 C
http://www.wpexplorer.com/wordpress-local-to-live/
) ~1 `- L- z8 c2 H2 H1 H0 v* ?' h1 t) z% [2 U) B5 v4 t
|
|