当使用自定义固定链接时,为什么所有页面都重定向到主页?

时间:2012-12-01 作者:user24306

我的网站http://laptopre.net/ 正在WP 3.4.2上运行。当我将Permalinks设置更改为Custom Structure-/%category%/%postname%/时,我网站中的所有页面都会重定向到homepage。

有谁能指导我解决这个问题吗。

这是我的内容。htaccess文件

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

###Please Don\'t edit these comments or the content in between. kloxo uses this to recognize the lines it writes to the the file. If the above line is corrupted, it may fail to recognize them, leading to multiple lines.

<Ifmodule mod_php4.c>
php_value error_log "/home/admin/__processed_stats/laptopre.net.phplog"
php_value upload_max_filesize 2M
php_value max_execution_time  30
php_value max_input_time  60
php_value memory_limit  32M
php_value post_max_size  8M
php_flag register_globals  off
php_flag display_errors  off
php_flag file_uploads  on
php_flag log_errors  off
php_flag output_buffering  off
php_flag register_argc_argv  on
php_flag magic_quotes_gpc   off
php_flag magic_quotes_runtime  off
php_flag magic_quotes_sybase  off
php_flag mysql.allow_persistent  off
php_flag register_long_arrays  on
php_flag allow_url_fopen  on
php_flag cgi.force_redirect  on
php_flag enable_dl  on
</Ifmodule>

<Ifmodule mod_php5.c>
php_value error_log "/home/admin/__processed_stats/laptopre.net.phplog"
php_value upload_max_filesize 2M
php_value max_execution_time  30
php_value max_input_time  60
php_value memory_limit  32M
php_value post_max_size  8M
php_flag register_globals  off
php_flag display_errors  off
php_flag file_uploads  on
php_flag log_errors  off
php_flag output_buffering  off
php_flag register_argc_argv  on
php_flag magic_quotes_gpc   off
php_flag magic_quotes_runtime  off
php_flag magic_quotes_sybase  off
php_flag mysql.allow_persistent  off
php_flag register_long_arrays  on
php_flag allow_url_fopen  on
php_flag cgi.force_redirect  on
php_flag enable_dl  on
</Ifmodule>
谢谢,Nghiep

1 个回复
SO网友:Chris

这是我的。htaccess。。。有一些差异,也许值得比较:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
</IfModule>
另外,我假设您在没有启用任何插件的情况下测试过这个?

结束

相关推荐

使用wp_reDirect重定向至固定链接

我正在使用wp\\u重定向更改404页面的URL:function show_404($message = \'page not found\'){ wp_redirect(home_url() . \'/error/404?m=\' . urlencode($message)); exit(); } 我创建了一个wordpress页面/error/ permalink。它在我的本地WAMP环境中运行良好(导航到时正确显示我的主题404页面localhost/