Ry Van
Ry Van

Reputation: 349

making php based url rewriter?

Is there any way to make a php-based URL rewriter? I want to make a URL rewrite module for my company's CMS.

For example:

http://www.seacen.org/v2/content.php?id=32&lang=1.htm

to

http://www.seacen.org/v2/content/32/1

Upvotes: 0

Views: 98

Answers (1)

Adi
Adi

Reputation: 5179

create a .htaccess file and paste the following inside it

Options +FollowSymLinks
RewriteEngine on
RewriteRule content/(.*)/(.*)/ content.php?id=$1&lang=$2.html

chances are that your mod_rewrite is already enabled, but if not:

  • If you're on a shared host, ask your host support to enable it for you.
  • If you're on a VPS or running your test server locally uncomment the following line in your httpd.conf LoadModule rewrite_module modules/mod_rewrite.s

Upvotes: 2

Related Questions