Mobile app version of vmapp.org
Login or Join
Murray432

: Can I have tracking parameters immediately after a forward slash /? I would like to start redirecting all /index.php pageviews to / to clean up GA data and otherwise simplify URL hits. Does

@Murray432

Posted in: #GoogleAnalytics #Redirects #Url #UrlRewriting

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. domain.com/?stay=1 | domain.com/?ref=adwords
Should these be ok?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

2 Comments

Sorted by latest first Latest Oldest Best

 

@Mendez628

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

www.example.com/?id=1

with

DirectoryIndex index.php index.html


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

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

but if you had

DirectoryIndex index.html index.php


the request would be

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.

10% popularity Vote Up Vote Down


 

@Heady270

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme