skip to Main Content

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

2

Answers


  1. 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].

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search