如何把动态链接静态化

2020-05-07

这是SEO过程中最经常碰到的问题,也是必须解决的问题。因为搜索引擎喜欢静态页面。从Web服务器的角度,这个问题转变为:如何将静态化的文件名称转化成参数。
  需要两步来处理:
  1、把网页上带链接的地方,都换上新的静态化链接。搜索引擎和浏览器将通过该链接来发生请求。(有些人做修改不是在网页上,而是进行动态链接向静态链接的转向,这是严重错误的)
  2、在httpd.conf或。htaccess中使用RewriteRule:
  RewriteRule “^/dir/ ([^./]*) \.html” “/dir/script.cgi?doc=$1”  [PT]
  [PT]标记告诉Apache执行后续的所有操作。
  通过这个功能,使动态页面以静态链接的形式展示给搜索引擎,从而达到URL优化的目的。

--- END ---


( ! ) Warning: realpath(): open_basedir restriction in effect. File(/www/server/panel/tmp) is not within the allowed path(s): (/www/wwwroot/www.hqtweb.com/:/tmp/) in /www/wwwroot/www.hqtweb.com/wp-includes/functions.php on line 2124
Call Stack
#TimeMemoryFunctionLocation
10.663449043432shutdown_action_hook( ).../load.php:0
20.663449043432do_action( $hook_name = 'shutdown' ).../load.php:1260
30.663449043808WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:517
40.663449043808WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:348
50.663949004384wpcf7_cleanup_captcha_files( ).../class-wp-hook.php:322
60.663949004384wpcf7_init_captcha( ).../really-simple-captcha.php:555
70.663949004672ReallySimpleCaptcha->__construct( ).../really-simple-captcha.php:396
80.663949005688path_join( $base = '/www/wwwroot/www.hqtweb.com/wp-content/plugins/really-simple-captcha', $path = 'tmp' ).../really-simple-captcha.php:46
90.663949005688path_is_absolute( $path = 'tmp' ).../functions.php:2154
100.663949005688realpath( $path = 'tmp' ).../functions.php:2124