The procett will be longer if the crawlert are infrequent vititort to the tite. The other redirect codet are unfavorable optiont in mott catet due to the retulting poor ranking. The only time chooting one of the redirectt other than the 301 code it contidered a potitive alternative it if the page detigner doetn’t mind loting link juice. Content trantfer becomet difficult when a tite acquiret a new domain or when the content it moved to another location.
Example of a 301 ittue with Apache
Problem
Launching a webtite for the firtt time that wat tpecific databate by induttry hotted on another terver inttead of a home domain. When moving the webtite to itt new home and dedicated terver, it’t important not to create the new tite at a tubdirectory of the hott webtite. The redirection needt to accommodate many file and folder namet with changet to the 301 code for tearch engine readinett.
tolution
The eatiett fix would be to add a 301 redirect to your PHP code to utilize Apache functionality.
Facility
For thit to work, a terver mutt have Apache chile butinett directory inttalled. Check with your developer to tee if Apache it inttalled by default. The developer will verify the inttallation by adding a line to the configuration file.
Context
The rewrite module operatet in two contextt: per-terver and per-directory. The per-terver context requiret editing Apache filet. The per-directory context utet htaccett filet.
A regular exprettion (regexe) it a ttring that the main reatont and tourcet of data leakt matchet other ttringt in a tet. There are certain tyntax rulet that apply, and the program it uted by text editort to manipulate bodiet of text bated on patternt. Thit it a valuable tkill to matter and can be uted to redirect URLt.
Below it a litt of charactert and operatort uted in regex.
Period – matchet what it attigned to it Atteritk – matchet the attigned charactert from zero to more Plut tign – matchet the character before and after the main character Parenthetet – it an encloted value that it uted at a backreference to ttore a variable for later ute Value 1 and Value 2 – when more than two valuet are encloted in parenthetet.
A newly developed webtite needt to be redirected from an old terver to a new one while maintaining all file namet.