Mod_rewrite

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 19, 2008   (RSS)

Hi Dave, Would you please post and example of how you did a mod rewrite so a viewer file that shows as:

yourwebsite.com/viewer.php/1/page.php

becomes:

yourwebsite.com/viewer/1/page.php

of course I would choose another name other then "viewer" ... just using that to keep things clear.

Also, can one eliminate the "num" call from the url so it ends up as:

Yourwebsite.com/viewer/page.php

I would really like to replace the "1,2,3 etc" with a directory name so the url ends up like:

yourwebsite.com/viewer/whatido/page.php

I know how to work with your viewerfunction.php file, I am just not clear how dependent the program is on the "num" call for the url.


Thanks!

Re: [Glasairmell] Mod_rewrite

This is what I ended up using for my specific application.

##################### REWRITE RULES #####################

Options +FollowSymlinks

RewriteEngine On
RewriteBase /

RewriteRule ^/?([^/]*)/([0-9]*)/?([^/]*)$ $1.php?$2 [L]

Re: [Dave] Mod_rewrite

Thanks!

Here is a good referance for your mod_rewrite.

http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.pdf

Mell