- 帖子
- 1008
- 主题
- 761
- 精华
- 0
- 积分
- 1794
- 贡献
- 941
- 激情
- 7771
- 阅读权限
- 100
- 最后登录
- 2020-4-28
|
[插件/教程] A method to use WOZ v1.5 and Ultimate SEO URLs
Open /includes/init_includes/init_woz.php o2 c* C) g1 `: l
Please edit a red partCode: G. j% Q% v/ D
+ ^/ g$ e L( Z, Z5 y* u- require_once(ABSPATH . 'wp-config.php');
- wp();
- if ($_GET['main_page'] == FILENAME_WORDPRESS && ( is_feed() || is_trackback() )) {
- gzip_compression();
- require_once(ABSPATH . WPINC . '/template-loader.php');
- exit();
- }
复制代码 5 e5 P2 z& h$ I
6 S# d% J5 R# x& D6 w! F3 G! @3 @) k$ ~; S1 Q" U$ k, _- f w1 a
Open includes\classes\ssu\cores\link.php4 P3 g$ @9 @1 D y' h
Please add a red partCode: g* j: u2 Y/ c# W( B
+ ] h# k( F# B7 `
6 N" @, Y6 T1 d, ?8 |- // if the index.php is in the url, lets see if we need to rebuild the path and redirect.
- if((strpos($this->original_uri, 'index.php') !== false)){
- if(!isset($_GET['main_page']) || empty($_GET['main_page'])){
- $_GET['main_page'] = 'index';
- $this->original_uri = $this->original_uri. '&main_page=index';
- }
- if($this->checkPageExcludedList($_GET['main_page']))
- return false;
- $this->redirect_type = 2;
- return false;
- }
- // for WordPress On ZenCart BOF
- else if($_GET['main_page'] == FILENAME_WORDPRESS){ return false; }
- // for WordPress On ZenCart EOF
- // if we are using multi-lang, then we should have language code at the very beginning
- if(SSUConfig::registry('configs', 'multilang_status')){
- $languages_code = substr($this->original_uri, 0, 2);
- if(!array_key_exists($languages_code, SSUConfig::registry('languages')))
- $this->redirect_type = 1;
- else{
- $_get['language'] = $languages_code;
- $this->original_uri = trim(substr($this->original_uri, 2), '/');
- }
- }
复制代码 , U: d e: k( N4 i
9 `1 {& `( k2 Z0 a+ m
$ e+ D# i9 u# e( N4 Y, l3 O( h
you’ll need to set the Ultimate SEO URL rewrite rules to ignore direct client requests for the /blog folder by using an additional RewriteCond.
) w- r" b/ D& ~ s' O0 d* t( ?eg)Code:
4 b" E( a6 P0 R" w. Z, q& {: {: D1 g2 m3 R/ v. ^
# w+ A3 K U1 G( T% ?( `
- # Donâ?™t rewrite blog directory
- RewriteCond %{REQUEST_URI} !^/blog.* [NC]
- RewriteCond %{REQUEST_URI} !^/wordpress.* [NC]
- # Handle all other URIs using Zen Cart (index.php)
- RewriteRule (.*) /index.php?%{QUERY_STRING} [L]
- # Do rewrite blog directory
- RewriteRule ^blog(.*)$ /index.php?main_page=wordpress&$1 [E=VAR1:$1,QSA,L]
复制代码
+ W& v2 f0 u; G: e
: m n4 K5 X: [( S重写规则,不同的服务器.大家自己看着改..# r1 D4 G: a; z. i
, W% k- d5 ~7 |: u2 u) jhttp://www.s-page.net/en/2010/04/22/a-method-to-use-woz-v1-5-and-ultimate-seo-urls/ |
|