LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-07-2016, 02:53 AM   #1
hruday
Member
 
Registered: Jun 2015
Posts: 88

Rep: Reputation: Disabled
avoiding landing page redirects


Hi iam using centos 7 with apache 2.4.6

i have a domain www.abc.com which redirects to www.abc.com/xyz.
how to cache above redirections?
 
Old 04-07-2016, 03:47 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,168
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Originally Posted by hruday View Post
Hi iam using centos 7 with apache 2.4.6

i have a domain www.abc.com which redirects to www.abc.com/xyz.
how to cache above redirections?
I'm not sure what you mean, but if you want to stop going to /xyz, you can change the DocumentRoot from /var/www/html to /var/www/html/xyz

Last edited by bathory; 04-07-2016 at 03:59 AM. Reason: typo
 
Old 04-13-2016, 06:31 AM   #3
hruday
Member
 
Registered: Jun 2015
Posts: 88

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
I'm not sure what you mean, but if you want to stop going to /xyz, you can change the DocumentRoot from /var/www/html to /var/www/html/xyz
Actually I have scanned my domain in gtmetrix. It shows www.abc.com is a permanent redirect to www.abc.com/xyz. So i need to cache these landing pages in order to decrease page loading time.

How can i cache redirects?

Last edited by hruday; 04-13-2016 at 06:34 AM.
 
Old 04-13-2016, 11:37 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,168
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Originally Posted by hruday View Post
Actually I have scanned my domain in gtmetrix. It shows www.abc.com is a permanent redirect to www.abc.com/xyz. So i need to cache these landing pages in order to decrease page loading time.

How can i cache redirects?
I still don't get what you're trying to do and how.
I don't think you can cache the redirection, but you can use the 301 response code to tell clients that it's a permanent redirect, so they don't cache the initial URL.
But I still suggest that you should change the DocumentRoot of your site and add /xyz to the end of the old one.
 
Old 04-13-2016, 01:16 PM   #5
hruday
Member
 
Registered: Jun 2015
Posts: 88

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
I still don't get what you're trying to do and how.
I don't think you can cache the redirection, but you can use the 301 response code to tell clients that it's a permanent redirect, so they don't cache the initial URL.
But I still suggest that you should change the DocumentRoot of your site and add /xyz to the end of the old one.
So you mean that I have to avoid rewrite rules and use document root. Right.!?
 
Old 04-14-2016, 01:58 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,168
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Originally Posted by hruday View Post
So you mean that I have to avoid rewrite rules and use document root. Right.!?
If you rewrite just / to /xyz without doing something fancy, then yes. Better change the docroot
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
httpd 2.4 "Error too many redirects" when accessing web page Altiris Linux - Software 1 08-02-2015 08:03 AM
Knowledgebase Portal Landing Page deibertine Linux - Software 3 03-02-2011 02:19 PM
Landing here gabrielmagno LinuxQuestions.org Member Intro 1 05-17-2009 01:12 PM
Anyone heard about landing problems of the A-380? frenchn00b General 14 07-04-2008 08:28 PM
pressing left and right mouse buttons at same time redirects to j-lo home page nickleus Linux - General 4 09-14-2006 08:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration