Can we rewrite WordPress page /ghij
to show the contents of page /faq
, when permalinks are already enabled?
My page is example.com?page_id=70&category=Footage
. After enabling permalink it is showing example.com/video-category?category=Footage
. I want it to look like example.com/category/Footage
.
Any help in this will be appreciated.
Current .htaccess
:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^page_id=([0-9]*)&category=(.*)$
RewriteRule ^(.*)$ /%1/%2? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Works. And redirects from:
http://test.com/index.php?page_id=70&category=Footage
To:
http://test.com/70/Footage
UPDATED:
RewriteRule ^(.*)/(.*)$ /index.php?page_id=$1&category=$2 [L]
This rule Works and makes inner redirect (without url change) from:
http://test.com/70/Footage
To:
http://test.com/index.php?page_id=70&category=Footage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With