How to change query string with pretty URL in WordPress using .htaccess file

Question

I want to create a SEO friendly URL in WordPress, i am developing a site in WordPress it has several custom pages with custom PHP Script.
I am sending data in id=”some text” and matching this text from my database when i GET[‘id’] the parameter.
i already selected my setting from dashboard.

Post name   http://domain.com/sample-post/ 

I have Currently this URL
domain.com/parent-page/child-page/?id=”some text”

and Now i want this one
domain.com/parent-page/child-page/some-text
I have modify my .htaccess file here is my code.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^parent-page/child-page/([a-zA-Z0-9]+)/$ parent-page/child-page/index.php/?id=$1
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

i don’t know why its not working

0
, Shehzad Ahmed 6 years 2017-07-18T06:04:23-05:00 0 Answers 69 views 0

Leave an answer

Browse
Browse