Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

4

Can I write multiple statements in a single htaccess? Yes, you can. Multiple <FilesMatch> containers in the same context (ie. .htaccess) are merged in order. So, you can block all .php files and permit a specific foobar.php file - in that order. For example: # Block all ".php" files <FilesMatch "\.php$"> Order deny,allow Deny from all </...


3

The proxy directives have to go on the the old machine. The machine that is acting like the pass-through needs to be configured as the proxy. On your new machine, you need to set it up with a different host name, like a sub-domain, .local domain, or IP address that can be accessed on your internal network. So the configuration should like like this: ...


2

You need the .htaccess file in the document root in order to rewrite a request of the form /area/somethingelse.php to the /pages subdirectory in the root (ie. /pages/area/somethingelse.php) before the .htaccess file in the subdirectory (ie. /pages/area/.htaccess) is able to rewrite the request a second time to /pages/area/pages/somethingelse.php - the ...


2

The usual way to "block" access to these files would be to serve a 403 Forbidden. For example, using mod_authz_core on Apache 2.4: <Files "*.inc"> Require all denied </Files> If you specifically want to respond with a 404 instead then you can use mod_rewrite. This needs to go near the top of your config file. For example: RewriteEngine On ...


2

You basically just need to remove the /de/.htaccess file altogether!*1 Your root .htaccess already performs the necessary redirects. (*1 Or remove all the directives and keep the ErrorDocument directive if you need a separate language-specific 404 file. But see the note below regarding the format of the ErrorDocument directive.) The RewriteRule ^index\....


1

Check your .htaccess for the redirections. I suppose it is an internal redirection made by WordPress. You can try this in the .htaccess. Make sure to have mod_rewrite activated in your server. RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com$ RewriteCond %{HTTPS} off RewriteRule ^(.*) https://www.example.com/$1 [QSA,L,R=301]


1

I don't know about compatibility between windows hosting and WordPress as I use neither of them. However from a performance point of view, I would imagine a Linux/Apache server would be better than an old windows server. Especially if the hardware is dated. Thinking about it, it could actually be more compatible as Linux and Apache are open source and free ...


1

I believe this can be done by changing IP of another.example to example.com and adding some codes in the .htaccess file. You certainly should not be "changing the IP" of any domain. (What was your reasoning behind this?) This sounds like a relatively simply redirect that can be performed in the .htaccess file. A condition is required that checks for the ...


1

To externally redirect the request from /product-configurator (I assume the missing u was a typo?) to /bikes-configurator when the HTTP Referer contains bikes=1 in the query string part of the URL then you could do something like the following using mod_rewrite near the top of your .htaccess in the document root: RewriteEngine On RewriteCond %{HTTP_REFERER}...


1

I got exactly same problem when deploy HA Wordpress on EC2 Apache web server under auto scaling group when spin up new EC2 Apache web server. 1. At first I think there are problem with apache web server: sudo vim /var/log/httpd/error_log [Tue Nov 05 ] [core:notice] [pid 2914] AH00094: Command line: '/usr/sbin/httpd' [Tue Nov 05 ] [mpm_prefork:notice] [pid ...


Only top voted, non community-wiki answers of a minimum length are eligible