LMAP .htaccess rewrite rules with google analytics - Help needed
-
If you're actually using .php pages w/o HTML, see https://stackoverflow.com/questions/15201082/where-to-add-google-analytics-code-to-a-php-website
There is no delay, it should either work or not from the GA console.
-
Ok, then something I am doing is wrong. And I don't know what.
/app/data/public/ .htaccess contains this
# Permanent URL redirect RewriteEngine on Redirect 302 / https://discord.gg/bGH$$$$$$$/app/data/public/ index.php contains this
<html> <head> <title> Cloudron LAMP app (PHP 7.4)</title> </head> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-H65R5$%#%@"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-H65R@#$$%#'); </script> <body> </body> </html> ` -
Ok, then something I am doing is wrong. And I don't know what.
/app/data/public/ .htaccess contains this
# Permanent URL redirect RewriteEngine on Redirect 302 / https://discord.gg/bGH$$$$$$$/app/data/public/ index.php contains this
<html> <head> <title> Cloudron LAMP app (PHP 7.4)</title> </head> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-H65R5$%#%@"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-H65R@#$$%#'); </script> <body> </body> </html> ` -
I'm not. I want all traffic going to sub.domain.com to be rerouted to another location.
I also want to track how this link is performing.
-
I'm not. I want all traffic going to sub.domain.com to be rerouted to another location.
I also want to track how this link is performing.
-
-
Actually, I just found
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=http://example.com"> <script type="text/javascript"> window.location.href = "http://example.com" </script> <title>Page Redirection</title> </head> <body> <!-- Note: don't tell people to `click` the link, just tell them that it is a link. --> If you are not redirected automatically, follow this <a href='http://example.com'>link to example</a>. </body> </html>And I found
<!DOCTYPE HTML> <meta charset="UTF-8"> <meta http-equiv="refresh" content="1; url=http://example.com"> <script> window.location.href = "http://example.com" </script> <title>Page Redirection</title> <!-- Note: don't tell people to `click` the link, just tell them that it is a link. --> If you are not redirected automatically, follow the <a href='http://example.com'>link to example</a> -
So I still don't know what is wrong. It should be working.

This is now what I have in index.php
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"><meta http-equiv="refresh" content="0; url=https://discord.gg/bG$$$$$$$"> <script type="text/javascript"> window.location.href = "https://discord.gg/bGH$$$$$$$" </script> <title>Community</title> </head> <script async src="https://www.googletagmanager.com/gtag/js?id=G-H65$$$$$$$"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-H65$$$$$$$'); </script> <body> <!-- Note: don't tell people to `click` the link, just tell them that it is a link. --> If you are not redirected automatically, follow this <a href='https://discord.gg/bG$$$$$$$'>link to our community</a>. </body> </html>This is my .htaccess file
# Permanent URL redirect # RewriteEngine on # Redirect 302 / https://discord.gg/b34345345345 -
J joseph marked this topic as a question on
-
J joseph has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login