LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-13-2019, 11:33 AM   #1
quqonlik
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Rep: Reputation: Disabled
Centos 7 apache configuration


Hello,

I have a question if someone can help me.

We are trying to add google analytics parameter to track down website traffic but whenever we're adding that parameter it is breaking login session and causing 404 page not found. Is there way to set query parameter to ignore GA tag while it opens website?

Here is an explanation:

https://test2.example.com/user/?_ga=3242394747129381203.3123123123 we are trying to ignore ga=allnumber

Original rewrite rule on 443 apache config:

RewriteRule ^/$ https://test2.example.com/user/ [NC,R,L]

Thanks,

Last edited by quqonlik; 06-13-2019 at 11:42 AM.
 
Old 06-13-2019, 12:48 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You could try the following:
Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} ^_ga=
RewriteRule ^user(.*)  https://test2.example.com/user/? [R,L]
Note that the question mark at the end of the rewritten URL is needed, so it doesn't attach the query string


Regards
 
Old 06-21-2019, 10:07 AM   #3
quqonlik
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
I tried the followings as well:


RewriteCond %{QUERY_STRING} &?_ga=([^&]+) [NC]

RewriteRule ^member/(.*) https://test2.example.com/user/?_ [NC,L]


RewriteCond %{QUERY_STRING} ^_ga=$

RewriteRule (.*) $1? [R=permanent]


No luck. GA tag is getting hardcoded or parameters aren't working.
 
Old 06-24-2019, 02:16 PM   #4
quqonlik
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
The following Query String worked:

RewriteCond %{QUERY_STRING} ^_ga
RewriteRule ^(.*)$ $1? [R=301,NC,L]

This can be resolved.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] NFS on CentOS 6 can talk to Centos 5 but not Centos 6 clients deathsfriend99 Linux - Server 2 11-08-2013 02:33 PM
Where to Add mod_evasive configuration to Apache configuration file.? Unknown3r Linux - Newbie 1 11-04-2012 10:09 AM
Web server configuration and issue (CentOS, Apache, PHP, MySQL) albie17 Linux - Newbie 2 01-08-2011 05:11 AM
Migrating Apache 1.3 configuration files to Apache 2 kaplan71 Linux - Software 0 03-28-2007 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:44 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