Jump to content

Friendly url trouble


yonta

Recommended Posts

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
Link to comment
Share on other sites

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) [snapback]367443[/snapback][/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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.