Very simple rewrite rule!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
erinther
Forum Newbie
Posts: 19
Joined: Sun Dec 11, 2005 2:07 pm

Very simple rewrite rule!

Post by erinther »

Hi,
I know it should be very very simple but I don't know how to do it.
I need a rule to change my url's:

Code: Select all

http://mydomain.com/blogs/whatever
to

Code: Select all

http://mydomain.com/whatever
Thanks.
monkey56657
Forum Newbie
Posts: 2
Joined: Sun Feb 17, 2008 2:46 pm

Re: Very simple rewrite rule!

Post by monkey56657 »

RewriteEngine On

RewriteRule /blogs/(.*) /$1 [L]
Untested. Whack it in a .htaccess file at site root.

You might need to remove the first / on the 2 strings on some server configs.
erinther
Forum Newbie
Posts: 19
Joined: Sun Dec 11, 2005 2:07 pm

Re: Very simple rewrite rule!

Post by erinther »

Sorry! It didn't work.
Post Reply