0

How to change the url http://www.kreativemines.com/blogpost.php/?post_slug=search-engine-optimization into http://www.kreativemines.com/blog/search-engine-optimization in php.

I have already use this rule from .htaccess file but there is no solution.

RewriteEngine On
RewriteRule ^blog/([a-zA-Z0-9_-]+)$ blogpost.php/?post_slug=$1
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
pankaj
  • 11
  • 1

1 Answers1

0

This should work :

RewriteEngine On
RewriteCond %{THE_RERUEST} /blogpost\.php/\?post_slug=([^&\s]+) [NC] 
RewriteRule ^ blog/%1? [NC,R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog/([^/]+)/?$ /blogpost.php/?post_slug=$1 [QSA,L,NC]
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
  • Its not working sir, I think some code changes required in blogpost.php. But i don't know what is that code changes. if you have some better solution than please share with us. – pankaj Aug 19 '15 at 04:39