PDA

View Full Version : Mod_rewrite issues


cinq
08-08-2004, 03:03 PM
Not sure if this is the right place to post this, mods please move accordingly if not. Thanks

Have an issue with mod_rewrite.
I ran the online generator at WebmasterTool kit and this is what was generated for me.


Options +FollowSymLinks
RewriteEngine on
RewriteRule mypage/(.*)/(.*)/(.*)/(.*)/$ /forum/mypage.php?$1=$2&$3=$4


This is the common URL without mod_rewrite implemented :

http://www.mydomain.com/forum/mypage.php?do=view&id=1


Using the above code, this is what will be displayed :

http://www.mydomain.com/forum/mypage/do/view/id/1


How do I go about only listing this:

http://www.mydomain.com/forum/mypage/1

What changes must I make to the mod_rewrite code above ?

Any help would be most appreciated.
Thanks :)

Xenon
08-08-2004, 03:15 PM
just add that as rewrite rule:

RewriteRule mypage/(.*)/$ /forum/mypage.php?do=view&id=$1

Dean C
08-08-2004, 03:36 PM
RewriteRule mypage/(.*)/?$ /forum/mypage.php?do=view&id=$1



I think you need that questionmark in there :)

cinq
08-08-2004, 11:32 PM
Thanks a million guys ! :D

So I am to have a RewriteRule for every page I want 'translated' , can I put them all one after another ( as in line by line ) ?

Sorry if this sounds dumb ( am new to this and frankly still don't quite get it ) :(

Xenon
08-09-2004, 12:52 PM
yes you can :)

cinq
08-09-2004, 01:11 PM
Got it, thanks again :D

Xenon
08-09-2004, 09:50 PM
you're welcome :)

cinq
08-16-2004, 12:45 AM
For those who may be interested in mod_rewrites or in case this thread comes up in a search,

this following link may prove useful to you :

http://www.daniweb.com/techtalkforums/thread9379.html

:)