LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Why Does the Leading / Get Removed From the URL When the Link is Clicked On in Google? (https://www.linuxquestions.org/questions/debian-26/why-does-the-leading-get-removed-from-the-url-when-the-link-is-clicked-on-in-google-4175645743/)

ehswift71 01-07-2019 03:57 PM

Why Does the Leading / Get Removed From the URL When the Link is Clicked On in Google?
 
Hi,

Our company hosts its website on Debian Linux using Apache 2.4. It uses the WordPress CMS platform and a plugin to direct from .php to .html, which seems to be working just fine.

But I've noticed a weird issue that I can't seem to fix. Here's an example.

When you look at the URL in the Firefox browser it does not have a slash at the end of the URL and looks like this: https://www.westgatecomputers.com

If I copy it from the address bar it loads with a trailing slash like this: https://www.westgatecomputers.com/

Here's the problem I have. When I am logged into the Google Search Console and using the robots.txt tester I hover over the link, "See live robots.txt" it shows me the correct link with the / before robots.txt but after clicked the leading / gets removed from the URL.

Before Clicked Link: https://www.westgatecomputers.com/robots.txt
After Clicked Link: https://www.westgatecomputers.comrobots.txt

The later link obviously results in an error, but how do I fix this?

This same issue was happening on the old website links in Google's index as well.

===================================================================

Here are contents of my .htaccess file.

# BEGIN Comet Cache WmVuQ2FjaGU (the WmVuQ2FjaGU marker is required for Comet Cache; do not remove)

# Enable GZIP compression.
<IfModule deflate_module>
<IfModule filter_module>
AddOutputFilterByType DEFLATE text/plain text/html
AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml
AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE font/opentype application/font-otf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype application/font-ttf application/x-font-ttf
</IfModule>
</IfModule>

# END Comet Cache WmVuQ2FjaGU

AddHandler cgi-script .bat .exe .pl .cgi
Options +ExecCGI +FollowSymLinks

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Brains 01-09-2019 06:05 PM

Clicking on the Before link does bring me to the text. Which shows many instances of:
Quote:

User-Agent: Blah blah
Allow: /
Quote:

When I am logged into the Google Search Console and using the robots.txt tester
Is there a https://www.westgatecomputers.com tester? Perhaps the line in red above needs to be added somewhere.


All times are GMT -5. The time now is 07:37 AM.