View unanswered posts | View active topics It is currently Fri Nov 24, 2017 5:35 pm



Reply to topic  [ 2 posts ] 
 Mod_Rewrite issues 
Author Message
Junior Member

Joined: Wed Mar 11, 2009 11:42 am
Posts: 2
Location: Ontario, Canada
Post Mod_Rewrite issues
Hello,

I have setup mod_rewrite on my site, so instead of having like
http://beta.berwari.net/index.php?display=movies

I can have it like http://beta.berwari.net/movies

but now I have a second parameter that is like
http://beta.berwari.net/index.php?display=movies&n=20

and this is how I want it to appear
http://beta.berwari.net/movies/20

I have been trying for days and still can't figure out how to do it

This is what I have

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ index.php?display=$1&n=$2
This works except the &n has always to be specified for other pages, because the display will have other values such as contact, link, music and so on.

I would really appreciate if somebody could help me with this.

Thanks in advance


Wed Mar 11, 2009 8:12 pm
Report this post
Profile
Junior Member

Joined: Wed Mar 11, 2009 11:42 am
Posts: 2
Location: Ontario, Canada
Post 
This is what I was looking for and thanks to mod_rewriting an entire site

I found the way, this is how I done it, in case somebody like me is trying to search for something simlar
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([^/\.]+)/?$ /index.php?display=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /index.php?display=$1&n=$2 [L]


Wed Mar 11, 2009 9:04 pm
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.