Here is my URL with SEO Title
http://prdemos.com/Web/2015/assetsrecovered/index.php/pages/page?seo=ar-about-us
i want to change it in
http://prdemos.com/Web/2015/assetsrecovered/ar-about-us
index.php/pages/page?seo=
this portion should be removed.
4
Answers
First of All i set
config.php
And
After that in
routes.php
I called the dynamic menu with slug (or SEO title), in my
header.php
My Controller is
pages.php
Finally i am getting these URLs
Remove
index.php
from url using.htaccess
like this,To remove remaining part, use
routes.php
to remove index.php
This .htaccess file will allow to write links without index.php in url, but it will still look like:
http://prdemos.com/Web/2015/assetsrecovered/pages/page?seo=ar-about-us
You need to modify your routes and controller to remove
?seo=
.In controller your action should be
public function page($seo)
something like this and route should be$route['pages/page/(:any)'] = "pages/page/$1";
and then in controller action function change your$_GET['seo']
to$seo
.And after this you can access your page like:
http://prdemos.com/Web/2015/assetsrecovered/pages/page/ar-about-us
If you want to remove
/pages/page
then you can add this to yourroutes.php
:$route['(:any)'] = "pages/page/$1
. But use this with precautions, because wrong placement in routes file can prevent other routes from working