redirect - Why are all pages redirecting to homepage when using custom permalinks?

admin2025-01-08  4

My website / is running on WP 3.4.2. When I changed the Permalinks setting to Custom Structure - /%category%/%postname%/ , all the pages in my site are redirected to homepage.

Could anyone guide me to solve this problem please.

Here is content of my .htaccess file

# 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.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.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>

Thanks, Nghiep

My website http://laptopre.net/ is running on WP 3.4.2. When I changed the Permalinks setting to Custom Structure - /%category%/%postname%/ , all the pages in my site are redirected to homepage.

Could anyone guide me to solve this problem please.

Here is content of my .htaccess file

# 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>

Thanks, Nghiep

Share Improve this question edited Sep 12, 2020 at 13:02 Jesse Nickles 7357 silver badges19 bronze badges asked Dec 1, 2012 at 15:22 user24306user24306 11 silver badge1 bronze badge 6
  • Your pages do not redirect when I try it. – s_ha_dum Commented Dec 1, 2012 at 15:52
  • It was because I changed the permalinks to default setting. It's now running in /%category%/%postname%/ setting, and you can see it redirects you to homepage when you click on the other 2 pages in the main menu which are laptopre.net/bao-hanh laptopre.net/thu-thuat-laptop – user24306 Commented Dec 1, 2012 at 16:25
  • You get a 404 on those pages, actually, not a redirect. – s_ha_dum Commented Dec 1, 2012 at 16:35
  • Just to throw this out: the only difference between your .htaccess and mine is an [OR]: – Chris Commented Dec 1, 2012 at 18:21
  • 1 Update to the latest version and see what happens. – Brad Dalton Commented Dec 27, 2014 at 15:12
 |  Show 1 more comment

1 Answer 1

Reset to default 0

Here's my .htaccess ... there are a few differences, perhaps it might be worth comparing:

# 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>

Also, I assume you have tested this without any plugins enabled?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736270040a1398.html

最新回复(0)