Main Page URL change

rpm

Admin
Staff member
Joined
Jul 22, 2003
Messages
66,805
Reaction score
5,057
Location
Johannesburg
Hi folks

I am starting to dislike the mybroadband.co.za/nephp/ part of the main page (was mentioned some time ago by Fergus I think). It looks like it will not be too tough to edit this to drop the nephp and still keep all the links live (my concern was about external links to specific articles). Any web-coders that can confirm that it will be possible to use .htaccess and redirects to ensure that these links do not die?

Do you feel it will be advantageous/valuable to drop the ‘nephp’? Is it worth the trouble? Your feedback will be great.

Regards,

RPM
 
Yeah, I still think its a good idea. Much more elegant :). What would be really cool is if we could use the myadsl.co.za domain again. Long live MyADSL!!!

Redirecting is quite simple if you have either mod_alias or mod_rewrite enabled. Using mod_rewrite you can do it like so:

Code:
RewriteEngine    on
RewriteRule    ^/nephp/?(.*)$  /$1 [R=301,L]

This will redirect any address that starts with /nephp to the same address minus the nephp part. Obviously this should only be done after you've moved the site to the new address.

So for example an address like this:

http://www.mybroadband.co.za/nephp/?m=show&id=382

would get redirected to this:

http://www.mybroadband.co.za/?m=show&id=382

Additionally the rule I used above will issue 301 http response which tells any search engine or robot that the document is moved permanently so they know to update their indexes. If you have myadsl setup as a virtual host you can place those 2 lines somewhere in the virtual host container. Theres some other ways to do it as well but thats probably the easiest.

If your apache doens't have mod_rewrite enabled you can usually enable it by uncommenting 2 lines in the httpd.conf and restarting the web server.

If you want to find out more about Apache redirects and mod_rewrite check out these 2 pages:

http://www.webmasterworld.com/forum92/82.htm
http://www.kuro5hin.org/story/2003/7/31/2335/08552
 
Hi RPM

As indicated quite possible, but lets remember to keep the /nephp "live" as this is what google news will be indexing ;-)

If we're simply doing transparent redirects as above it would not be a problem...

R
 
Top
Sign up to the MyBroadband newsletter
X