Tracking htaccess redirects? - .htaccess

is it possible to track htaccess redirects (without Google Analytics)? I would like to know how many people visit a certain (redirect) URL.
The use case is as follows:
The folder 'links' on my server has a htaccess file in it with all the redirects.
I would like to know how many people visit 'links.DOMAIN.com/topic' and, thus, get redirected to https://somethingelse.com.
We don't use any Google products. Analytics would otherwise be the obvious choice.
I'm out of ideas, tbh.
Thank you in advance! :)

Related

duplicate URLs in my page, best solution?

I have a website that write URLs like this:
mypage.com/post/3453/post-title-name-person
In fact, what is important is the post and ID part (3453). The title I just add for SEO.
I changed some title names recently, but people can still using the old URL to access, because I just get the ID to open the page, so:
mypage.com/post/3453/post-title-name-person
mypage.com/post/3453/name-person
...
Will open the same page.
Is it wrong? Google webmaster tools tells me that I have 8765 duplications pages. So, to try to solve this I am redirecting old title to post/id/current-title but it seems that Google doesn't understand this redirecting and still give me duplications.
Should i redirect to not found if title doesn't match with the actual data base? (But this can be a problem because links that people shared won't open) Or what?
Maybe Google has not processed your redirections yet. It may take several weeks and sometimes several months to process all pages, especially if they are not revisited often. Make sure your redirects are 301 and not 302 (temporary).
That being said, there is a better method than redirections for duplicate pages: the canonical tag. If you can, implement it. There is less risk to mix up redirections.
Google can pick your new URL's only after the implementation of 301 redirection through .htaccess file. You should always need to remember that 301 re-direct should be proper and one to one to the new url. After this implementation you need to fetch those new URL via Google Search console so that Google index those URL's fast.

.htaccess redirects - I am completely lost

I am trying to create some redirects using htaccess but I am quite a bit overwhelmed with it all. So here it goes.
The NEW domain is hosted on my hosting account but there is no site built. I just want to use the domain for "easier" branding. Here is what I am trying to achieve.
I want people who go to my NewDomain.com be redirected to an external site: blog.OldDomain.com/podcast/
I also want to create redirects to upcoming new posts. For example, I want to send people to NewDomain.com/1 and have them redirected to blog.OldDomain.com/episode1. Then NewDomain.com/2 would redirect to blog.OldDomain.com/episode2, etc.
I hope someone can help me with this!
Thanks!
Ok nevermind, I found the solution. Simply created
Redirect 301 /index.html http://olddomain. com/podcast/
and I will add new lines as I create new pages ;)

Why big websites like cnn are using robots.txt and not better htaccess?

In my opinion is is not wise.
e.g. check this:
http://edition.cnn.com/robots.txt
http://www.bbc.co.uk/robots.txt
http://www.guardian.co.uk/robots.txt
according from this:
http://www.joomla.org/robots.txt
Joomla.org have not changed the default administration folder :D
E.g. prestashp page has a blank robots.txt file which is not perfect, but at least better in my opinion:
http://www.prestashop.com/robots.txt
Are these people stupid or they think that it is ok to know how they web strtucture look like?
Why are they not using htaccess to deny access for robots etc?
The problem is that .htaccess can't intuitively tell that a visitor is a search engine bot.
Most bots will identify themselves in the user-agent string, but some won't.
Robots.txt is accessed by all the bots looking to index the site, and unscrupulous bots are not going to
Identify themselves as a bot
Pay any attention to robots.txt (or they will deliberately disobey it).

Htaccess.. changing the domain name

I have a big Joomla website that was moved from .com to .eu domain.
The sites are on one web server.
On the old website there are a lot of links that point directly to oldwebsite.com/somethinghere.
Is there a way with Htaccess file in the old domains folder to redirect
from oldwebsite.com/somethinhere to newwebsite.eu/somethinghere?
Or maybe a way to do this on the new website folder?
Thank you,
Chris.
There are many ways, some people recommend using RewriteEngine, but there is an easier way:
Redirect 301 / http://domain.eu/
This will automatically handle files in the domain -- for example, old.com/foo will be redirected to new.eu/foo
EDIT: Regarding "301", that is the code for a permanent redirect. There also exist temporary redirects (I believe the code is 302), but it sounds like what you need is exactly this - a permanent redirect.
EDIT2: Oh and, I think the / after domain.eu may be required, but I'm not 100% sure - doesn't hurt for it to be there, that's for sure! I know that because I use the same kind of a redirect on a production website.

Dynamically creating URLs for other websites

I'd like to know how websites have created URLs with other domains like these on trafficestimate.com.
I'm guessing it's some .htaccess stuff to redirect domain names to a dynamic page?
Thanks
Your URL has an GET Request. So when someone calls the page http://google.com/search with the parameters hl=en, safe=off etc., the page can process those parameters. So for instance safe=off means that you want to get back any search result. The q=site:... is your search string. In this case Google will look it up in its database and give you the results. So when you call this URL there is probably no .htaccess processing done. However you can process the URL and GET request with .htacces and i.e. redirect the user to another page.
Maybe you'll describe a bit further what exactly you trying to do/want to know. This makes explaining easier.
EDIT: After reading Gumbo's comment I looked at the Google result page. So maybe your question means the trafficestimate-URLs. They look like http://trafficestimate.com/example.org. This is really a good case for .htaccess. So using .htaccess they take the URL and redirect it to http://www.trafficestimate.com/websites/?domain=example.org. Here you have again a GET request and an application builds the page.
Some URL rewriting is probably involved. Otherwise they would have to create an existing file for every possible request.
Using Apache’s mod_rewrite in a .htaccess file is one option. But since the server identifies itself with “Microsoft-IIS/7.5”, they are probably rather using ISAPI_Rewrite, a mod_rewrite derivative for Microsoft’s IIS.

Resources