Jump to content


Photo

Friendly url trouble


  • Please log in to reply
1 reply to this topic

#1 yonta

yonta
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 22 April 2006 - 01:40 PM

Hi

I want to turn this url
www.example.com/blog/index.php?action=Projects or www.example.com/blog/index.php?action=Project&id=1
into
www.example.com/blog/index/Projects or
www.example.com/blog/index/Project/1.

So far reading some tutorials i've got this (based on the tutorial at phpfreaks on mod_rewrite)

RewriteEngine On
RewriteRule ^index/(.*).php /index.php?action=$1
RewriteRule ^index/(.*)/(.*).php /index.php?action=$1&id=$2

but it isn't working. I also tried this, thinking maybe it was because the site's inside the blog folder

RewriteEngine On
RewriteRule blog/^index/(.*).php /index.php?action=$1
RewriteRule blog/^index/(.*)/(.*).php /index.php?action=$1&id=$2

but it didn't work either. I put the .htaccess file inside the blog folder.

Can anybody help? Please?

Thanx :)

Sofia
do it, do it right, do it right now

#2 yonta

yonta
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 22 April 2006 - 10:54 PM

Help please... some pointers...

Sofia

[!--quoteo(post=367443:date=Apr 22 2006, 08:40 AM:name=yonta)--][div class=\'quotetop\']QUOTE(yonta @ Apr 22 2006, 08:40 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi

I want to turn this url
www.example.com/blog/index.php?action=Projects or www.example.com/blog/index.php?action=Project&id=1
into
www.example.com/blog/index/Projects or
www.example.com/blog/index/Project/1.

So far reading some tutorials i've got this (based on the tutorial at phpfreaks on mod_rewrite)

RewriteEngine On
RewriteRule ^index/(.*).php /index.php?action=$1
RewriteRule ^index/(.*)/(.*).php /index.php?action=$1&id=$2

but it isn't working. I also tried this, thinking maybe it was because the site's inside the blog folder

RewriteEngine On
RewriteRule blog/^index/(.*).php /index.php?action=$1
RewriteRule blog/^index/(.*)/(.*).php /index.php?action=$1&id=$2

but it didn't work either. I put the .htaccess file inside the blog folder.

Can anybody help? Please?

Thanx :)

Sofia
[/quote]

do it, do it right, do it right now




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users