I developed my site jobgurus.com.ng with codeigniter. For SEO purpose, How do I change the view page url form www.jobgurus.com.ng/jobs/view/system-support to www.jobgurus.com.ng/jobs/system-support
I want to remove the /view in the url.
Any help will appreciated. Thanks
You can try using the following code in your .htaccess
file:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^view/(.*)$ /$1 [L,NC,R]
Explanation of the flags used:
L -> Last
NC -> No case comparison
R -> Redirection
Note: The default code for redirection is 302. You can change it to 301 of you want that by setting: [L,NC,R=301]
.
If job
is your controller name and view
is your method, You can use route of CI. Add below line in file application/config/routes.php
$route['job/(:any)'] = 'job/view/$1';
you can list similarly all possible links there.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.