homepage Welcome to WebmasterWorld Guest from 184.72.69.79
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
mod rewrite and 301
How to 301 mod rewrite rule
troyid




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

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?

 

tomda




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

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();?>

jdMorgan




msg:1498756
 4:13 pm on Sep 6, 2004 (gmt 0)

troyid,

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

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved