Forum Moderators: phranque

Message Too Old, No Replies

htaccess mod rewrite question

Problem with friendly static URL rewrite

         

Henny

2:23 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Hi all!

I am having the followinf issue, I am trying to get the end result to be this:

http://www.example.com/index/VHS/6303451659.shtml

instead of this:

http://www.example.com/index.php?mode=VHS&item=6303451659

I have tried the following:

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^index/([^.]+)/([^.]+).shtml$ index.php?mode=$1&item=$2 [L]

and i tried this:

RewriteRule ^index/(.*)/(.*).shtml$ index.php?mode=$1&item=$2 [L]

neither works, to make sure my host supports htacces and mod rewrite, I tested with this:

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^index.shtml$ index.php [L]

and went to:

http://www.example.com/index.shtml

and that did provide my script so I know the mod rewrite IS possible if I can just smarten up a bit :p

Any help is really appreciated!

[edited by: jdMorgan at 2:44 pm (utc) on Sep. 16, 2005]
[edit reason] No URLs, please. See TOS. [/edit]

jdMorgan

2:50 pm on Sep 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your regular-expressions pattern is incorrect. Try This:

RewriteRule ^index/([^/]+)/([^.]+)\.shtml$ /index.php?mode=$1&item=$2 [L]

Jim

Henny

2:55 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Man, no joy, I cannot figure this one out, here is the new .htaccess upon your recommendation:

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^index/([^/]+)/([^.]+)\.shtml$ /index.php?mode=$1&item=$2 [L]