Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: Ocean10000 & incrediBILL & phranque

mod rewrite and 301

How to 301 mod rewrite rule

   
9:24 am on Sep 6, 2004 (gmt 0)

10+ Year Member



I have some pages that are dynamically generated that i would like to redirect to another page name.

The url currently looks like

[domainname.com...]

The number at the end of this url is different for all links.

I want to show the link as

[domainname.com...] and also permantely redirect the url [domainname.com...] to [domainname.com...]

Can this be done?

10:17 am on Sep 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am not so good in modrewrite and 301 is still new for me, so it is just a guess for the 301 redirect.

This the PHP method for a 301 redirect.
Just put these lines at the beginning of file and give it a try.


<?
if(isset($_GET["ID"])) {$ID=$_GET["ID"];} else {$ID="1";}
header("HTTP/1.1 301 Moved Permanently");
header("Location:
http://www.domainname.com/vote/".$ID.".html");
exit();?>
4:13 pm on Sep 6, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



troyid,

It can't be done the way you're expecting to do it. See this thread for more info: [webmasterworld.com...]

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month