0

I'm using CodeIgniter and I want to redirect links like this:

example.com/?p=25

to this:

example.com/25

How can this be achieved?

jdphenix
  • 15,022
  • 3
  • 41
  • 74
Zuhair Taha
  • 2,808
  • 2
  • 35
  • 33

2 Answers2

1

http://www.askaboutphp.com/58/codeigniter-mixing-segment-based-url-with-querystrings.html

or

to create url like this : http://yyyy.com/article/finishing-dan-snapshop-salkulator

add this code in routes.php $route['article/(:any)'] = "article/readmore/$1";

description : 1. article : class name 2. readmore : method from class article 3. $1 : get value from uri segment 2 value

denyptw
  • 100
  • 6
0

its .htaccess rewrite rule.make sure u have activated mod_rewrite .then put this line into website application root .htaccess file

RewriteRule ^/([0-9]+)/?$ p=$1 [NC,L] # Handle product requests