I am working on a blog, and my current blogpost URL is looking like this
https://myblog.com/blog-inner.php?url=my-awesome-life
Now I want to rewrite this URL to look like
https://myblog.com/blog/catogory/my-awesome-life
Please note: we have a single category for each blog.
So how can we rewrite its URL in .htaccess
and what are the procedure to display this blog perfectly.
CodePudding user response:
Here is
RewriteEngine On
RewriteRule ^/blog/catogory/(.*)$ blog-inner.php?url=$1 [L]
RewriteRule ^/blog/catogory/(.*)/(.*)$ blog-inner.php?url=$1&something=$2 [L]
CodePudding user response:
you can try it like this
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]