Forum Moderators: phranque

Message Too Old, No Replies

Modrewrite urls before or after launch of website?

seo urls on localhost or when website is live?

         

Dilly

2:37 pm on Sep 11, 2007 (gmt 0)

10+ Year Member



Hi,

I would like to know whether or not it is possible to use modrewrite on urls on localhost in order to make them more seo friendly?

OR

Have I got to wait for the website to be launched and then use modrewrite to seo the urls?

btw, I have never previously used modrewrite or launched a website and have urls which have .php extensions and contain parameters.

Note: I have been reading up on this website for the last 3 months whilst constructing my website using php and mysql.

Thanx for the help in advance.

[edited by: Dilly at 2:39 pm (utc) on Sep. 11, 2007]

jdMorgan

2:51 pm on Sep 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It would be self-defeating to launch the site with one set of URLs, and then add friendly URLs and mod_rewrite code after the fact. The search engines might very well pick up the unfriendly dynamic URLs, and then you'd immediately start telling them to change them to the friendly static ones. Not a sign of 'quality'...

The answer to whether you can rewrite the URLs before going to a live server hinges on whether or not you have Apache installed on your localhost. If you do, then you can deploy and fully test the friendly-URLs solution. If you don't then testing would be difficult at best.

Jim

Dilly

4:42 pm on Sep 11, 2007 (gmt 0)

10+ Year Member



Thanx jd for the reply.

I do have apache installed on localhost so I guess I need to start using modrewrite now.

I have been doing some digging and found this great modrewrite post(tutorial) by you. Jd's Post [webmasterworld.com]

Just had one question.

I understand that I would need all the links in my php pages to point to the new friendly urls and can use preg_replace to do this.

can you give me an example of how i can use preg_replace for a link such as:

<?php
echo"<a href=\"make.php?id=$id&amp;modelname=$name\">$name</a>";

?>

to be changed to..

<?php
echo"<a href=\"make/$name-$id.html\">$name</a>";
?>

Thanx jdMorgan you have been a great help to me.

[edited by: Dilly at 4:53 pm (utc) on Sep. 11, 2007]

jdMorgan

10:16 pm on Sep 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm no PHP wiz, so I'll refer you to our PHP forum [webmasterworld.com] for that... :)

Jim