473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Best Option For Redirect

omerbutt
638 512MB
Hi ,
i was in an argue with one of my colleagues on redirection i have been using the .htaccess for redirecting urls to new domain urls , now the question is that if i have changed my domain to a new domain lets say from abc.com to xyz.com and i have the same name of the pages and everything , i want that my old urls lets say

abc.com/profile/omer


should be redirected to

xyz.com/profile/omer


what my colleague recommends is to use
Expand|Select|Wrap|Line Numbers
  1. strstr()
  2.  
and find the domain name (abc.com)in the url and replace it with the new domain (xyz.com) and include it in the config file which is already included in all pages , and not to use the .htacess redirect as we have to type in all the urls into the .htaccess file , seems to be short though and quick , but i always go for the safest option , what do anyone of you recommend doing , one more thing the way strstr() is used that means that all the pages need to exist on the old site (abc.com) as well as new site (xyz.com) would that cause any difference to the indexing on google? or would the similar text on both the domains create the problem for the bots? , any SEO regarding problem using the strstr() method?
Reagrds,
Omer Aslam
Jun 17 '11 #1

✓ answered by nathj

The advatnage of using .htaccess is that you can specify it as a 301 redirect. This method maintains any link equity that you may have built up with search engines like Google and Yahoo.

Which is what Markus is doing with the '[R=301]' part of the line.

If you do it with php functions you will damage the link equity you have built up.

Cheers
nathj

2 1639
Markus
6,050 Expert 4TB
If you will be redirecting all pages from your old domain to your new one, a simple redirect from the server (via .htaccess or whatever) would suffice. Something like:
Expand|Select|Wrap|Line Numbers
  1. RewriteRule ^(.*)$ http://newdomain/$1 [R=301]
  2.  
Jun 17 '11 #2
nathj
938 Expert 512MB
The advatnage of using .htaccess is that you can specify it as a 301 redirect. This method maintains any link equity that you may have built up with search engines like Google and Yahoo.

Which is what Markus is doing with the '[R=301]' part of the line.

If you do it with php functions you will damage the link equity you have built up.

Cheers
nathj
Jun 21 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul Say | last post by:
I have a asp.net application that will need to create a document/report from data in a database. The user will fill out a form supplying various criteria for parameters. I would like the...
3
by: Gustavo | last post by:
Does anyone know what would be the best way to have a website have access to the clients computer (with his permission ofcourse when ) so he can save and upload files by the click of a webform...
2
by: jetal15 | last post by:
To develop a Framework for Content management system, which contians three part 1) core part 2)Data storage and retrival and 3)Workflow In Core part there is need to develop communication layer...
5
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I need to store lots of product images. I was thinking of storing the paths in the database but overtime it may become cumbersome as I'll be dealing with lots of images. I would need to...
9
by: | last post by:
In my database I have a 'control table' in which basic info is stored about the application, for instance the application's path and the name of the company that is using it. In all of the...
4
by: cprot225 | last post by:
I am a web developer who works plenty with SQL Server, and I really know very little about Access. But I have a project now that requires me to know something about it so I've been doing quite a bit...
1
by: mh | last post by:
I'm porting a C lex/yacc based project, and would like to redo it in python. What's the best option for a python lex/yacc-like? I've googled a few things, but wanted to see the current...
1
by: Michael Fuller | last post by:
We are currently searching for a solution to manage data. We have a bunch of laboratory and field analytical data in an Access 2003 database. We also have some plant process data that is recorded...
0
by: Carles Bolaños | last post by:
Hello everyone I have develop a plugin based Job scheduler in C++. This program is console based and multiplatform. Implements a list and the plugins have the logic of the job, the program only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.