Jump to content

Htaccess redirect cause policy violation with adsense.


Black Tiger

Recommended Posts

Hello.

I ignored it a couple of times but I keep getting a policy violation from Google Adsens various times.

This is the redirect I use, which is made by the forum software:

	<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
	# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
	RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]
	RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
	RewriteRule ^forum/index\.php$ /? [L,R=301]
	</IfModule>

And this is what Google is complaining about. In fact this is an old link from my old SMF forum before conversion to SMF:
www.satellitefun.org/forum/index.php?action=login

when visiting this page,, you will be redirected to:

https://www.satellitefun.org/forum/index.php?action=login

which causes an error Foutcode: 1S160/2 page does not exist. Logically.

If redirected it should be redirected to:
https://www.satellitefun.org/login/

or to my forums which are at /forums/ and not at /forum/

As far as I can see this is the only one giving problems. Normal threads are redirected correctly to my forum.

Issue is that Google states this needs to be fixed. It's a " Valuable Inventory: No content" problem.

I would like this to be fixed some how, or I even don't care if in this .htaccess I can just take care Adsense does not see this anymore and the problem is solved.

Anybody a clue on how to fix this?

Link to comment
Share on other sites

4 minutes ago, Black Tiger said:

Thank you.

I presume due to the other redirects (especially the last one), I have to put this in the beginning of my .htaccess file?

Below the "RewriteBase /" statement?

By the way... Merry Christmas!

Yes, after

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
	# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
	RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]
	RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
	RewriteRule ^forum/index\.php$ /? [L,R=301]
	</IfModule>

 

Link to comment
Share on other sites

Ah, the internal server error occured because i was using the // Redirect old file, and .htaccess does not see // as comment, had to use # for that.

However, I can put the line where I want, it does not redirect. Not when putting it after RewriteBase / and not after </ifmodule> or as first line, it just does not redirect.

I'm just wondering why Adsense is still looking at that location though. I converted my forums almost a year ago, why is it still looking at old url's which are not present in the sitemap either anymore as far as I know?

Link to comment
Share on other sites

Same result.

I'm just wondering. My control panel (Directadmin) forces non-www to www and http to https automatically, I guess via a virtual host adjustment.

This can't have anything to do with it can it? On the other hand, why do the thread redirects work correctly?
Still I wonder why Adsens is not ignoring this, because it redirects to an error.

Just to be sure this is my default complete .htaccess:

<IfModule mod_expires.c>
  ExpiresActive On
	  # Images
  ExpiresByType image/jpeg "access plus 1 day"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType image/x-icon "access plus 1 year"
	  # Video
  ExpiresByType video/mp4 "access plus 1 year"
  ExpiresByType video/mpeg "access plus 1 year"
	  # CSS, JavaScript
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
	  # Others
  ExpiresByType application/pdf "access plus 1 month"
  ExpiresByType application/x-shockwave-flash "access plus 1 month"
</IfModule>
	<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
	# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
	RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]
	RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
	RewriteRule ^forum/index\.php$ /? [L,R=301]
	</IfModule>
	Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Header set X-Content-Type-Options "nosniff"
# Header set Referrer-Policy: no-referrer-when-downgrade
# Header set X-Frame-Options "SAMEORIGIN"

Link to comment
Share on other sites

Try replacing this

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
	# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
	RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]
	RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
	RewriteRule ^forum/index\.php$ /? [L,R=301]
	</IfModule>

with this

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteRule ^([^/]*)/$ /forum/index.php?action=$1 [L]
	# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
	RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]
	RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
	RewriteRule ^forum/index\.php$ /? [L,R=301]
	</IfModule>

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...