We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [htaccess]

Directory-level configuration file found mostly on Apache web servers

69 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
305 views

Ubuntu 14.04 can't enable .htaccess

I'm developing a website local and just switched from Windows to Ubuntu 16.04 - Sadly my .htaccess doesn't seems to work since rewrite rules don't apply and sources can't be found. I activated: sudo ...
3
votes
0answers
32 views

Redirected to www, but Google is indexing no-www without snippets, should I use noindex instead?

I started my blog a month ago and was using non www version for my website. Then, I recently decided to stick to www.example.com version. So I changed it and Google has indexed the www version ...
3
votes
1answer
37 views

What is the Cloudflare equivalent of these two .htaccess redirect rules?

I usually set up my sites to rewrite URLs in the following cases: All http traffic is redirected to https (and www), with a 301 All non-www traffic is redirected to www (and https), with a 301 In ....
3
votes
0answers
37 views

Why are my HTML resources re-downloading despite having an expiration date a month in the future?

I have set the expiration information for my resources in the .htaccess file as shown below: <IfModule mod_expires.c> ExpiresActive on ExpiresByType image/jpeg "access plus 1 month" ...
2
votes
0answers
61 views

Is it safe to do a htaccess rewrite for mobile traffic to amp pages?

I have a requirement to use the same URL for both desktop and mobile devices. On mobile, I want to serve amp HTML while on the desktop I want to render normal HTML. In such case is it safe (from SEO ...
2
votes
0answers
100 views

Local browser caching not working due to .htaccess rules

All the JavaScript files hosted from my server are not being cached - just those from 3rd party CDNs. The information on caching is bountiful, but I've been unable to create something that works. I'...
2
votes
0answers
121 views

htaccess requesting password twice

I am using .htaccess to password-protect a directory. When users attempt to log in, they enter a username and password, and are refused access --- but if they try a second time, they get in just fine ...
2
votes
0answers
412 views

.htaccess for two languages and corresponding redirect for every page based on accept-language

I have a website www.example.es, with this structure: www.example.es index.php 404.html somepage.html www.example.es/en index.php 404.html somepage.html I want to redirect any language but es to ...
2
votes
0answers
666 views

Apache basic authentication without instant prompt for credentials

I'm looking for away to eliminate the intrusive instant prompt for credentials when basic authentication is used and instead serve a nice page that tells the user where he is and what credentials to ...
2
votes
0answers
478 views

How to use .htaccess rewrite rules to remove .php and folders from URLs?

I'm trying to simplify the URLs using rewrite condtions and rules on my local WAMP website. For example I would like to have /ProjetSyntheseFAC/mammiferes instead of /ProjetSyntheseFAC/pages/animaux/...
2
votes
0answers
673 views

Redirecting domains, sub domains and single pages on Siteground

I'm having serious issues with Siteground to get my redirects working. They did work on another hoster so it is possible. However, that server configuration was very different so I cannot copy what we ...
2
votes
0answers
91 views

.htaccess to show a page from the main site on another domain

I have 2 x domain names https://www.example.com - This is my main site. http://www.example-liverpool.com This is my Liverpool sub website example.com/liverpool I've presently got URL forwarding ...
2
votes
0answers
424 views

Edit .htaccess so that homepage of Laravel site mirrors homepage blog

I have a Laravel site at example.com and a WordPress site at blog.example.com. Everything works well except that I'd love to have the root (index page) of example.com show (but not redirect to) the ...
2
votes
0answers
278 views

.htaccess on IIS. Helicon Ape Manager does not convert htaccess to web config

I want to use PHP and .htaccess on my IIS server. I already know that the .htaccess is not supported by IIS. I know that the .htaccess need to convert to the web config. I want to try with Helicon App ...
2
votes
0answers
34 views

Could an .htaccess affect charset options in another directory?

My company is still running a ~12 year old CMS for project management and until yesterday it was working fine. Then I uploaded a version of Tiki Wiki CMS to complete separate folder on the same ...
2
votes
0answers
143 views

RequireAll blocks overriding each other

I have recently converted a pre-2.4 configuration to Apache's new authorisation configuration but ran into a problem/misunderstanding concerning more than one RequireAll block. What I am basically ...
2
votes
0answers
333 views

Separate multiple domains with htaccess (solution works on one hosting, not on another)

I have two different domains on one VPS. It's Apache 2.4.7, I remember trying long to set up name based Virtualhosts on localhost to find out Apache Virtualhosts are not supported anymore. (I cannot ...
2
votes
0answers
818 views

ExpiresByType not working for PNG images when set in .htaccess for a WordPress site

In my website I have the expires headers settings reported below. When I use Google's PageSpeed Insights test I get the message: XYZ.png expire headers not set, which I'm getting for all the PNG files ...
2
votes
0answers
251 views

Replacement for DirectoryIndexRedirect for older versions of Apache

DirectoryIndexRedirect is available in version 2.3.14 and later. (mod_dir) Is there an alternative method for older versions? I have different DirectoryIndex directive sets for a lot of directories ...
2
votes
0answers
895 views

404 error on a file/directory that exists?

We are using the vBulletin system. I have set it up so that it redirects 404 errors to a PHP page, so it follows the theme of the forum. However, if I go to a directory that exists (the admin ...
1
vote
1answer
37 views

Use .htaccess to redirect to add .txt extension

I have a .txt file on my hosting and would like to redirect to it if somebody enters an specific website within their browser, e.g. example.com/webpage --> redirects to --> example.com/...
1
vote
1answer
59 views

Can certain pages load without “.html” extension, instead of whole site?

I set up my website so that all pages load without the .html extension, using the following code in the .htaccess file: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ...
1
vote
0answers
58 views

Considering changing URL structure from example.com/page?id=1 to example.com/1/keywords but wondering what SEO impact is

Currently our website has a variety of community generated content that is under the URL structure of example.com/page?id=1. Some of these pages rank quite well on Google due to a combination of ...
1
vote
1answer
33 views

Using htaccess to redirect 301 for domain change

I am currently moving a domain from one to the other, this is not an HTTPS move but rather a move from exampleone.co.uk to exampletwo.co.uk. I am using this code: <IfModule mod_rewrite.c> ...
1
vote
0answers
42 views

invoke a URL Perl script silently, without changing URL visible to client

I've been fighting the Google canonical page algorithm bug for 2+ months. Following various forum advice and suggestions haven't solved it yet, although for sure they've made our website better. One ...
1
vote
0answers
46 views

After implementing HTTPS, “require valid-user” in subdirectory no longer asks for password, just gives 401 Not Authorized

I'm not very knowledgeable about server scripting, however I've only just installed SSL certificate for the domain. The main website (hosted by GoDaddy) is now working fine on SSL/TLS and I've ...
1
vote
0answers
77 views

Infinite redirect loop with IIS 8.5 Drupal

After configuring my website, i stuck in a infinite redirect loop. I have 6 domains, example.com is main domain. example1.com, ..., example5.com are forwarding to example.com. Doesn't matter which ...
1
vote
0answers
64 views

How to allow Google fonts to be cached for more than one day?

I tried this code below, but I still see the message on Google Insights that the fonts have a expiration of 1d. AddType application/vnd.ms-fontobject .eot AddType application/x-font-ttf .ttf AddType ...
1
vote
0answers
106 views

Combining password protection and redirects in .htaccess file

I'm a designer who developed a simple site with HTML and CSS. I'm completely new to .htaccess so it's not surprising I'm struggling to get the file to work as I want. Problem 1: I want to password ...
1
vote
0answers
652 views

Cannot figure out how my nodejs application run with apache

I need to push my node app updates to remote host which is really wired. It uses standard cPanel + apache bundle, but also has node installed. Root domain mywired.host hosts static files from ...
1
vote
0answers
35 views

.httaccess password protection not working on recently updated browsers

My situation is this: I have a web folder on an Apache server protected with standard .httaccess password protection. It's been working fine for years and the code hasn't been modified in any way. In ...
1
vote
0answers
764 views

How do I serve webp images from my WordPress site but exclude the WP backend/admin

For some reason that I cannot fathom, my Chrome installation does not show me webp images from my website. I can see webp images on other sites (I think - how can you tell if you are being served a ...
1
vote
0answers
48 views

How best to handle a common mis-spelling of my domain name?

My surname is Kirkby, but very often people mis-spell it, by leaving out the second 'k' and so spell it as Kirby. My domain name is kirkbymicrowave.co.uk, but I took a guess that a few people at ...
1
vote
0answers
116 views

Mod_Security false positive, how can I whitelist?

I am getting the following error while I am trying to create a web service. How can I white list this user agent? I am not really able to understand the following error message. [error] [client ...
1
vote
0answers
246 views

.htaccess How to redirect some specific pages, then a blanket rule to new domain?

I am creating a new website on a new domain, and doing page-to-page redirects from the old website for (A) all static pages, as well as (B) all blog posts. A) The static pages follow a new URL ...
1
vote
0answers
83 views

How to setup htaccess to show new posts on WP site?

I'm using VPS CentOS + Apache + Wordpress. Not using any Cache plugin but htaccess instead. All work good except my home page wont refresh if I write new post. Only new visitors can see new posts. ...
1
vote
0answers
154 views

.htaccess IP whitelist is being ignored

I have the following in my .htaccess file to only allow access from a block of IP's and everyone else is being redirected: <IfModule mod_rewrite.c> RewriteEngine On Options +FollowSymlinks ...
1
vote
0answers
81 views

Fastest .htaccess redirect from example.com to www.example.com?

Now using the standard cPanel-created Apache .htaccess redirect, but it's taking a full 2 seconds to go from ´example.com´ to ´www.example.com´. Is there a faster method? Or should I let go of the ...
1
vote
0answers
691 views

Google can't crawl my rewritten URLs

I tried to submit my robots.txt and sitemap.xml for hours now - changing directories and .htacces rules like a horse. For some stupid reason Google can't crawl my pages and gives me warnings, that my ...
1
vote
0answers
97 views

Using SetEnvIf to not log overly accessed URLs

I'm trying to figure out how to craft my SetEnvIf's in my apache config so that the server hard disk isn't spinning 24/7 over log entries. What I want to do is disable logging for all domains and ...
1
vote
0answers
142 views

Problem with http to https redirect

I have the following .htaccess file (in www.example.com/folder1/folder2) RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] to map any HTTP request ...
1
vote
0answers
558 views

URL masking to subdomain redirecting to subdomain

I am trying to change the URL of a Joomla site in browser my original URL is like example.com/marketsite/abc and I want to change it to abc.example.com/marketsite/abc I am using following code in ...
1
vote
0answers
416 views

Random domain pointing to my domain

A random person has pointed their domain to my website. I don't have much experience with websites, but I know a bit. What can I put in .htaccess to give a 403 error if they try to access from a ...
1
vote
0answers
310 views

How to Exclude URL From PageSpeed Modification

I am currently working with the PageSpeed module and one of the URLs it is modifying I need to restrict. Here is the page I am looking at but it does not seem to have the solution for restricting the ...
1
vote
0answers
197 views

Parallels Plesk Apache dedicated server shared IP / A Address serving default page

My Website Works when you go to it, however Google Adwords is telling me that my site is redirecting/ not showing up properly to their bots. When you put the site into a website checker like GT ...
1
vote
0answers
216 views

Inconsistent 301 redirects at GoDaddy

I am getting mixed results when using GoDaddy's built-in URL forwarding feature. While these redirects work when using the browser, a test with redirectcheck.com sometimes shows the following result: ...
1
vote
0answers
47 views

Security and Apache Methods

I occasionally get annoying POST requests but one lately caused a 500 error. Not a biggie really, but it got me thinking. My site does not have but one form. Outside of this, POST should not exist ...
1
vote
0answers
93 views

htaccess issue with URL masking

I am attempting to mask an URL using an htaccess file to only show the root URL. This is a Drupal 7 website, so I want the URLs to look like the following: Main page: http://www.site1.com Drupal ...
1
vote
0answers
300 views

Cloudflare putting my site in an endless refresh loop

This problem does not happen to all site visitors. The best I can tell, random users of Chrome have the issue but my sample size is way too small to believe that it is only Chrome. However, a few ...
1
vote
0answers
156 views

Using .htaccess rewrite rule that doesn't run for specific folders and files

I want to create a .htaccess file that reads index/somepage as index.php?q=somepage. This is how far I got: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} (gif|jpe?g|png|js|css|...