Posts

Showing posts from January, 2022

All pages are not being redirected to HTTPS when accessed using HTTP

All pages are not being redirected to HTTPS when accessed using HTTP - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, wordpress, apache, https, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I'm running a Wordpress blog that has an issue with HTTPS redirect. Except home page, no other URL is being redirected to HTTPS if you visit via HTTP. I want to redirect all HTTP traffic to HTTPS. Currently, only the Home page( http://www.example.com ) is being redirected to HTTPS if you try with HTTP. but if you visit http://...

How to 301 redirect old domain to new domain on same host with SSL and avoid Privacy Error

How to 301 redirect old domain to new domain on same host with SSL and avoid Privacy Error - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, https, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : Here's the environment: Apache, mod_rewrite.c exists WordPress Two domains that point to the same webhost, we'll call them www.olddomain.com www.newdomain.com We have an SSL Certificate for www.newdomain.com, but not www.olddomain.com, as per the rules about needing two separate IPs for separate SSL certifi...

404 errors turning into 500 errors through internal redirects

404 errors turning into 500 errors through internal redirects - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, apache, , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : Today I checked my Apache error.log and I found many: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. ...mostly from Bing bot. So i traced the error to my access log and I found that these e...

Check for URLs that return my 404 error page

Check for URLs that return my 404 error page - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, 404, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have made a custom 404 error page called error_404.html In my .htaccess I inserted: ErrorDocument 404 /error_404.html In order to control/correct 404 errors in my website, I would like to know which URL requests return this page. Is there a way I can check which URL or log requests that return the error_404.html page ? Solution : You do not need a cust...

How to redirect URLs with a specific IDs to new URLs on a new domain name?

How to redirect URLs with a specific IDs to new URLs on a new domain name? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, apache, 301-redirect, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I want to redirect all pages where there is a specific word inside in the URL. Both websites have the same articles. For example: videos.example.com.ph/its-showtime-hashtags-hashtags-and-dawns-popular-dance-moves_966aaafd8.html should be redirected to example.com.ph/its-showtime-hashtags-hashtags-and-dawns-popular-dan...

.htaccess Redirect Old Threads

.htaccess Redirect Old Threads - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have moved to mybb to vanilla and want to redirect old threads to the new format, so the indexed threads on Google aren't lost. The old format is showthread.php?tid=3003 Whereas the new format is index.php?p=/discussion/3003 How would I redirect this via .htaccess ? Solution : You will want to use a 301 redirect (permanently moved) so that google will update its indexe...

How to deny direct access to font files used in CSS?

How to deny direct access to font files used in CSS? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, css, fonts, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have a website that displays texts with unique, copyrighted fonts. I use a CSS file with "font-face" elements (see the example below) and I store the font files in a folder called "type". I would like to deny direct access to these files, so visitors could not copy them. I tried to add an .htaccess file, but it broke the code. (I guess...

.htaccess rewrite , parked domain on another site to read the proper domain name

.htaccess rewrite , parked domain on another site to read the proper domain name - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about domains, htaccess, mod-rewrite, url-rewriting, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have a parked domain example.co.uk on another domain name web-space in a folder and need to rewrite the domain name in the browser URL as it currently shows the other domain name while browsing and I need it to read example.co.uk. When parking the domain the ISP automatically added this which works althou...

How do I enable compression to reduce the file transfer size on GoDaddy?

How do I enable compression to reduce the file transfer size on GoDaddy? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, css, javascript, godaddy, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have hosted one of my website on godaddy.com . How do I enable compression to reduce the file transfer size? I need to compress the .css and .js files. I tried the following but it doesn't work : SetOutputFilter DEFLATE Header append Vary User-Agent Solution : By compressing .js and .css , do you mean to minfy th...

Use .htaccess to rewrite any subdomain to the corresponding subdir without revealing the subdir

Use .htaccess to rewrite any subdomain to the corresponding subdir without revealing the subdir - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about domains, htaccess, subdomain, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have a little problem with my .htaccess . For example, if I go to test.example.com , it's in folder /sub/test . But it shows test.example.com/sub/test . How can I hide the path after .com ? Or is there any way to do it with Apache, like all folders in sub folder are subdomains? I don't know how to...

How can I set my robots.txt file to let bots not crawl certain folders in root directory?

How can I set my robots.txt file to let bots not crawl certain folders in root directory? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about html, htaccess, search, seo, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have a small website with about 20 pages with .html extensions, containing unique articles I wrote consisting of about 1000 words or more. These 20 pages are the main feature of my site. Root Directory My root directory is structured in such a way that all 20 pages of my HTML files are in the root directory, not co...

Block company domain from apache website how?

Block company domain from apache website how? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, apache, , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : so I am running a site on apache. I want to block all visitors from domain *.xyz.com I tried adding the following in .htaccess file: <Files *> order allow,deny allow from all deny from .*example.com.* </Files> this didnt work. Can anyone help? Solution : Not really. A webserver does not directly know the domain of its users which they may not even hav...

How do I redirect www and non but not IP

How do I redirect www and non but not IP - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, mod-rewrite, redirects, ip-address, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I am trying to redirect www.domain.com or domain.com to www.domain.com/temp.html I am using the following code: RewriteCond %HTTP_HOST ^.*$ RewriteRule ^/?$ "http://www.domain.com/temp.html" [R=301,L] That works however I do not want to redirect IP. So if someone types in the static IP of the domain then I do not want them to be redirecte...

Duplicate title tags and meta descriptions after removing .html extension from files

Duplicate title tags and meta descriptions after removing .html extension from files - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about seo, google-search-console, htaccess, duplicate-content, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : Google Webmaster Tools/Search Console is giving me errors regarding duplicate title tags and meta descriptions. The website in question is a static HTML website. All documents do have a .html extension. In order to remove the .html from all documents I am using the code below in my .htaccess ...

Rules in .htaccess to block spiders don't appear to be effective, I still see the crawlers in Awstats

Rules in .htaccess to block spiders don't appear to be effective, I still see the crawlers in Awstats - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, , , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have Put this code in htaccess to prevent search engines accessing my site However, I still see them listed daily in the AWSTATS file on my sever. Does this mean they are still searching my site? They haven't infiltrated the site but just logged as an attempt? # Stop the Nasties!! RewriteEngine on RewriteCon...

Can .htaccess be changed through FTP after it was edited in WordPress in a way that breaks the site?

Can .htaccess be changed through FTP after it was edited in WordPress in a way that breaks the site? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about seo, htaccess, redirects, ftp, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I made the mistake of putting in the following code on my .htaccess file thru Yoast SEO: # Remove www from any URLs that have them: RewriteEngine on RewriteCond %HTTP_HOST ^www. RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] Now there's an infinite loop and I can't access my WordPress dashbo...

Too many redirects due to htaccess code

Too many redirects due to htaccess code - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, drupal, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : TL;DR: What does the following line of code do? Does it remove trailing slashes from a URL? RewriteRule ^(.*)/$ http: // %HTTP_HOST/$1 [R= 301 ,L] I inherited a Drupal site with little knowledge of how htaccess files work. We have a folder, let's call it "culture" in our document root. In the culture folder we have a index.html file. So that'...

Is there a "current directory" variable in .htaccess RewriteRule?

Is there a "current directory" variable in .htaccess RewriteRule? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, , , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : In a .htaccess file in the subfolder "/preview" (not in document root), I have this rule: RewriteRule !^public/ /preview/forbidden.php [L,R] It redirects all /preview/"something" requests that are not in /preview/public/ to the fobidden message. However, I don't like the fact that the directory name "preview" ...

Redirecting from a link but allowing the link to still be visited with htaccess

Redirecting from a link but allowing the link to still be visited with htaccess - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, 301-redirect, , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have three versions of an article on a website. Each one is written a few years after the last and updates the topic to keep it fresh and I want to redirect traffic from the older ones to the newer ones. However, I Still want people to be able to visit the older ones via links in each updated article. How can I use .htaccess ...

Redirect multiple files using .htaccess

Redirect multiple files using .htaccess - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about seo, htaccess, redirects, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have a lot of files with a lot of sub directories which I moved one folder up, so, say, instead of example.com/cdn/folder/folder/file.html , it now looks like this example.com/folder/folder/file.html . My problem lies in SEO, I have a lot of back links which point to files which used to be in the old directory structure, and everyone who tries to access these files...

Internal redirection: Serve “/site” as “/” and “/sub/blog” as “/blog”

Internal redirection: Serve “/site” as “/” and “/sub/blog” as “/blog” - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, shared-hosting, , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I have a website with a shared hoster. There are a few things that I have there, like main site, Piwik, a blog and other standalone things. Right now I have the following structure: ~/subs/www gets served as example.org and www.example.org ~/subs/blog gets served as blog.example.org ~/subs/app/piwik gets served as app.example.org/p...

how to fix .htaccess - redirect http://408.111.1111.domain.us/ to http://domain.us/index.php?w=408.111.1111

how to fix .htaccess - redirect http://408.111.1111.domain.us/ to http://domain.us/index.php?w=408.111.1111 - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about apache, htaccess, mod-rewrite, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : We want to use mod_rewrite and .htaccess to do a redirect. How do we redirect http://408.111.1111.domain.us/ and www.408.111.1111.domain.us/ to http://domain.us/index.php?w=408.111.1111 ? If the original URL has a dash in place of the periods, or no periods in front of '.domain.us'...