Jump to content

Url rewriting with .htaccess


vinsb

Recommended Posts

Hi,

first I'm sorry if I posting this in wrong forum. 

So I've tried to make my url a little bit more 'user friendly' with .htaccess. For example this URL's

http://localhost/index.php?currentpage=1
http://localhost/page.php?pn=1
http://localhost/gifs.php?id=1
http://localhost/pic.php?cat_id=1&id=5

My .htaccess content is:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^currentpage/([^/]*)$ /index.php?currentpage=$1 [L]
RewriteRule ^pn/([^/]*)$ /page.php?pn=$1 [L]
RewriteRule ^id/([^/]*)$ /gifs.php?id=$1 [L]
RewriteRule ^category-([^/]*)/([^/]*)$ /pic.php?cat_id=$1&id=$2 [L]

ErrorDocument 404 http://localhost/404.php

But it doesn't work...

Link to comment
https://forums.phpfreaks.com/topic/286879-url-rewriting-with-htaccess/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.