Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite again.

         

mattscotney

6:58 am on Apr 5, 2007 (gmt 0)

10+ Year Member



Hi again,

I have the following dynamic url:

[mysite.com...]

I would like to be able to mod rewrite that request to the more search engine friendly format of:

[mysite.com...]

I have a reasonable idea of exactly what I am trying to do but the .htaccess code I use for this never seems to work correctly.

Any help would be greatly appreciated :)

mattscotney

8:04 am on Apr 5, 2007 (gmt 0)

10+ Year Member



Thanks, I think I might have solved it, thats always the way an hour after you post, you finally come up with a solution.

I decided to dump the articles directory and serve the articles directly from an articles.php file in the root directory.

I have come up with:
RewriteRule articles/(.*) articles\.php?articleid=$1

It seems to work and it has simplified the process somewhat too.

Hope it helps someone else looking for the same type of thing.

g1smd

12:19 am on Apr 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Don't forget to force either www or non-www on to the target URL too, otherwise you are letting duplicate content problems into your site.