I'm trying to add .htaccess
for specific page in wordpress child theme. Actually i'm sending category slug in url to custompostpage.php
displaying post by category slug. For getting the category slug i'm using cp=
action at end of the url.
http://example.com/demo/project/custom-post-page/?cp=search-engine-marketing
Functionality working fine.. But I want to remove the ?cp=
for SEO purpose. For the task i'm using following .htaccess
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^custom-post-page/([^.]*)$ custom-post-page?cp=$1 [QSA,L]
</IfModule>
But it does not working. I upload this .htaccess file in the child theme (same path of custompostpage.php
).
Can anyone guide me that can i add .htaccess file in the child theme using wordpress or not? If yes then where i'm doing wrong in my coding. I would like to appreciate if someone guide me. Thank You