Why my htacess rewrite return 404?
-
I have many url links in /abc/ sub-directory, like
http://www.domain.com/abc/products-12345
http://www.domain.com/abc/products-23456
http://www.domain.com/abc/products-34567
http://www.domain.com/abc/new-items
Now I want to url rewrite
/abc/products-
to/def/products-
http://www.domain.com/def/products-12345
http://www.domain.com/def/products-23456
http://www.domain.com/def/products-34567
http://www.domain.com/abc/new-items
Here is my .htaccess file
RewriteEngine On RewriteRule ^abc/products-(.+)$ def/products-$1 [R=301,L] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule>
but when I type
http://www.domain.com/abc/products-12345
in browser, it redirect tohttp://www.domain.com/def/products-12345
, but it show404
. I tried to addecho get_query_var('page_id');
in 404 page, it return0
. How to solve it?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Why my htacess rewrite return 404?’ is closed to new replies.