Can I have tracking parameters immediately after a forward slash /?

Can I have tracking parameters immediately after a forward slash /? - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Can I have tracking parameters immediately after a forward slash /? error on your web browser. Problem :


I would like to start redirecting all /index.php pageviews to / to clean up GA data and otherwise simplify URL hits.



Does anyone foresee this causing any problem when using tracking parameters?



E.g. www.domain.com/?stay=1 | www.domain.com/?ref=adwords



Should these be ok?


Solution :

I use URL parameters like that in some cases. I've never had a problem with it. All browsers seem to support it fine.



Although in most cases that works, it relies on a specific configuration of Apache, which may happen to not be set or be in a different order and then the expected behaviour would fail. It also relies on not having other index file mentioned on the DirectoryIndex before the .php file.



DirectoryIndex determines which files and in which order the server is going to look for when a directory is requested, which is what happens when you end the URL's path with '/'.



It is usually configured like this, more or less:



DirectoryIndex index.php index.html


Which tells the server to look for the file index.php if a directory is requested, if it is not found, then look for index.html and so on if you add more options to that line. But if instead of that, you had this



DirectoryIndex index.html index.php


And you had an index.html file, the expected behaviour would fail because the server would look find index.html and it will pass the query string to that file, which doesn't know what to do with it.



An example:



Let assume that you make this request



 http://www.example.com/?id=1


with



DirectoryIndex index.php index.html


tt results in this next URL to be used for the server



 http://www.example.com/index.php?id=1


but if you had



DirectoryIndex index.html index.php


the request would be



 http://www.example.com/index.html?id=1


So, the safe way to do things is to add the file you want to work on the URL, or add that directive to your .htaccess file, or be sure that you don't have any other file with common name on the same folder, like index.html



Of course I'm talking about Apache, but it could be any other server that has similar behaviours and directives.


We hope that this article has helped you resolve the google-analytics, redirects, url error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=