|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hallo experts.
Would you tell me how to do a redirect? We have to change few pages in our HP, and need new URLs for them. However, is redirect actually the best way? I ask this, because my webmaster is not very helpful nor reliable, so I have to do it by myself. Many Thanks |
|
|||
|
Aside from getting a new webmaster, you can do it yourself with .htaccess if you are on Apache
Code:
Redirect 301 /oldfolder/oldpage.php http://www.domain.com/newfolder/newpage.php |
|
|||
|
What about redirecting index.php?s12 to static pages? I tried .haccess redirect, but that did not work.
__________________
Neteffects - Europe Search Marketing Europe Business Directory Ranking Directories - Resource of Search Engine Ranking Directories. |
|
||||
|
If you leave the old url page on your server (a good idea) you can try adding the following to your coding in the HEAD section:
<META NAME="ROBOTS" CONTENT="noindex,follow"> AND the following script: <script language="JavaScript"> if (parent.location.href == self.location.href){ window.location.href = 'index.html' } </script> NOTE: that the 'index.html' needs to be whatever page you want to redirect TO. That might work for .php pages. If it does, you can change the coding for the content part of the page to a clickable link redirect that people will see. This prevents having pages with duplicate content on your site and provides for a manual redirect just in case the script in the head section doesn't work. Simplistic, and kind of the long way around the barn, but an "if all else fails" suggestion nonetheless.
__________________
The Weedy Lady at http://www.happydaycards.com Free E Cards for holidays and all occasions, fun pages and great recipes. |
|
|||
|
While the suggestion from Weedy Lady will work, it won't move the SERPs from your old page to the new one.
If you want to make URL's move like you're pointing to I believe mod_rewrite is in order. In your .htaccess file, do something like the following. Code:
RewriteEngine On RewriteRule ^index.php?(.+)$ http://www.site.com/dir/$1.html [I,O,RP,L] Code:
RewriteEngine On RewriteRule ^dir/(.+).html$ http://www.site.com/index.php?$1 [L] If you need any more assistance, Google can find a log about mod_rewrite, or just ask. Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
|||
|
I had to edit that a few times to get the $ in the right places. Ugh. Should be right now. I need to learn to use preview.
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
|||
|
Sorry, I did a poor job explaining myself. I dont want to use URL rewrite, but are going to drop an old script for a new one.
I want to redirect page for page from an old script with dynamic URLs to a new script with totally diffrent ant static URLs. Tried using .htaccess with Redirect 301 /url http://url, but that does not seem to work with .php?123 type pages. Kim
__________________
Neteffects - Europe Search Marketing Europe Business Directory Ranking Directories - Resource of Search Engine Ranking Directories. |
|
|||
|
Quote:
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
|||
|
If your pages are dynamic... and you want to "redirect page for page"
A simple way might be: <? ~pseudo correlation method here~ parse the url, database look up, etc.. ~end pseudocode ~ header("HTTP/1.1 301 Moved Permanently"); header("Location:/$newpage"); exit(); } ?> Just place the 'header' calls before any output.
__________________
Hardcore Programming Solutions and Coffee Drinker |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |