Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Closed Thread
 
Thread Tools Display Modes
Share |
  #1  
Old 11-17-2016, 12:01 PM
rk484 rk484 is offline
Contributing Member
 
Join Date: 10-24-16
Posts: 65
iTrader: 0 / 0%
301 Redirection to a new url

Hello,
Can you let me know what I have to write in the .htaccess file for redirecting a single-old page URL to a single new-page URL.
Also, where do I need to put this in the htacess file, at the bottom or somewhere else.
I came to know that the file should be uploaded in ASCII mode after doing all the editings. Please guide me.

Thanks in advance.
 

Advertisement

Advertisement

  #2  
Old 11-17-2016, 01:08 PM
Woomeister's Avatar
Woomeister Woomeister is offline
Contributing Member
 
Join Date: 11-10-16
Location: Gloucestershire
Posts: 1,262
iTrader: 0 / 0%
google it.

There are different ways dependant on browser age etc, java. I'm not going to give you code just for you to say 'but what about?' etc.

Google 'url redirect code'
 
  #3  
Old 11-17-2016, 07:06 PM
Kajan's Avatar
Kajan Kajan is offline
Contributing Member
 
Join Date: 10-10-16
Location: Sri Lanka
Posts: 99
iTrader: 0 / 0%
You can use redirection plugin where you can easily redirect your old URL to new URL.
 
  #4  
Old 11-17-2016, 07:28 PM
LMD's Avatar
LMD LMD is online now
Contributing Member
 
Join Date: 11-04-12
Location: Where my wife tells me to be. :)
Posts: 6,777
iTrader: 0 / 0%
Quote:
Originally Posted by Kajan View Post
You can use redirection plugin where you can easily redirect your old URL to new URL.
Why use a plugin, with reams of code, taking up more memory, when you can just add a few lines of code to an htaccess file??

Quote:
Originally Posted by rk484 View Post
Hello,
Can you let me know what I have to write in the .htaccess file for redirecting a single-old page URL to a single new-page URL.
Also, where do I need to put this in the htacess file, at the bottom or somewhere else.
I came to know that the file should be uploaded in ASCII mode after doing all the editings. Please guide me.

Thanks in advance.
Here, let me Google that for you: How to code a 301 redirect in the htaccess file.
 
  #5  
Old 11-17-2016, 08:02 PM
Kajan's Avatar
Kajan Kajan is offline
Contributing Member
 
Join Date: 10-10-16
Location: Sri Lanka
Posts: 99
iTrader: 0 / 0%
Quote:
Originally Posted by LMD View Post
Why use a plugin, with reams of code, taking up more memory, when you can just add a few lines of code to an htaccess file??
I never know that we can redirect by add some code in htaccess file. That's why I'm using redirection plugin.
By the way, I can change my redirection method by adding code to htaccess file.
Thanks for that
 
  #6  
Old 11-18-2016, 08:34 AM
memodorial's Avatar
memodorial memodorial is offline
Contributing Member
 
Join Date: 10-10-15
Location: Solar System. Planet Earth
Posts: 229
iTrader: 0 / 0%
Quote:
Originally Posted by LMD View Post
Why use a plugin, with reams of code, taking up more memory, when you can just add a few lines of code to an htaccess file??
.htaccess file slows down page speed, meaning that it will slow down entire website if it's located in root directory. Because of that many content management systems rely on PHP headers.
 
  #7  
Old 11-18-2016, 08:49 AM
LMD's Avatar
LMD LMD is online now
Contributing Member
 
Join Date: 11-04-12
Location: Where my wife tells me to be. :)
Posts: 6,777
iTrader: 0 / 0%
Quote:
Originally Posted by memodorial View Post
.htaccess file slows down page speed, meaning that it will slow down entire website if it's located in root directory. Because of that many content management systems rely on PHP headers.
What has the redirect to do with the CMS? We've never seen any visible issue with page load times because of redirects. Remember, for the most part, redirects aren't needed forever either. I'd never add another plugin to bloat a WP site to do something a few lines of code can accomplish.
 
  #8  
Old 11-18-2016, 11:41 AM
memodorial's Avatar
memodorial memodorial is offline
Contributing Member
 
Join Date: 10-10-15
Location: Solar System. Planet Earth
Posts: 229
iTrader: 0 / 0%
Quote:
Originally Posted by LMD View Post
What has the redirect to do with the CMS? We've never seen any visible issue with page load times because of redirects. Remember, for the most part, redirects aren't needed forever either. I'd never add another plugin to bloat a WP site to do something a few lines of code can accomplish.
I've said it for development purpose. If you are not writing the code yourself and relying on plugins then you should know that this is Coding Section.

Look what Apache documentation tells us:
Quote:
You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server.
Speaking about resource-leaking WP, last time I've tested it with slowest 2G internet made me laughing when I saw that fresh installed site loaded in ~25 seconds.
 
  #9  
Old 11-18-2016, 01:49 PM
LMD's Avatar
LMD LMD is online now
Contributing Member
 
Join Date: 11-04-12
Location: Where my wife tells me to be. :)
Posts: 6,777
iTrader: 0 / 0%
Quote:
Originally Posted by memodorial View Post
I've said it for development purpose. If you are not writing the code yourself and relying on plugins then you should know that this is Coding Section.
The OP was asking about 301 redirects pertaining to htaccess - to which I responded.
 
  #10  
Old 12-24-2016, 10:30 AM
liquidwebcouponcodes liquidwebcouponcodes is offline
Junior Member
 
Join Date: 12-24-16
Posts: 13
iTrader: 0 / 0%
If you want to redirect few links, a .htaccess sounds like a good idea, but if you wish to redirect multiple links and track them (statistics) it's a good idea to use a plugin
 
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Redirection... rujuta SEO Forum 3 10-29-2010 06:39 PM
SSL redirection detoam Coding Forum 1 02-11-2010 01:25 PM
cPanel Redirection = 301 redirection? sixty6 Web Hosting Forum 0 08-09-2006 08:07 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 01:41 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC