New answers tagged

1

Try wrapping your AuthUserFile in AuthType Basic AuthName "Restricted Access" AuthUserFile "/var/www/html/server-auth/.htpasswd" Require user manu That solved the issues for me.


0

Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘*, example.com’ Curious, that's as if Header merge had been called, rather than Header set? "Merged" values like this are not officially supported by the Allow-Control-Allow-Origin header, so browser support may vary and will explain why it's not working for you. if there's a way ...


0

Redirect /accesories /accesories/items Yes, that will result in a redirect loop because the mod_alias Redirect directive is prefix-matching, as per the Apache docs (highlighting my own): ...any request beginning with URL-path will return a redirect request to the client at the location of the target URL. Additional path information beyond the matched URL-...


2

If you provided both the file and the ldap authentication providers (using the AuthBasicProvider ldap file directive), then you can define the following ruleset in order to be able to authenticate from both. I'm assuming that you use the uid attribute as username, but if not, it shouldn't be too hard to rewrite the condition below. <RequireAny> <...


1

Try something like the following instead, at the top of the .htaccess file, before the WordPress front-controller: RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^(index\.php)?$ http://some-other-domain.com/ [P] The RewriteBase and RewriteEngine directives are not required here. The RewriteEngine presumably already appears later in the file as part of ...


0

Solved Wordpress .htaccess rewrites everything, including the ErrorDocument directives, that are used by HTTP Basic Authentication, 401 and 403 return codes. I had personalized SHTML files for ErrorDocument (default in cPanel servers). So, instead of ask for a password, it rewrites the HTTP headers, asking for the password and showing a 404 error page at ...


0

You can create multiple RewriteRule directives with regular expressions within your server configuration. You should start with the specific redirects with changed permalinks. The general redirect for all other pages can be added at the end. RewriteEngine On RewriteRule ^/kennisbank(/.*)?$ https://vastgoedmentor.com/resources$1 [END,R=301] RewriteRule ^/...


0

Try the following at the top of your .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^(?:www\.)?example\.com [NC] RewriteCond %{QUERY_STRING} ^id=(\d+) RewriteRule ^view$ https://example.ca/search-item.html?psid=%1 [R=302,L] The %1 backreference contains the captured URL parameter value from the preceding CondPattern. Change the 302 (temporary) ...


-1

Your htaccess file should work, it should be placed in the root directory. Have you tried Redirect instead? Redirect 301 /folder/ http://www.example.com/new_path/


1

I've expressed my concern in comments that there must be "something else" going on, but anyway... It's difficult to write an exception for a rule that shouldn't (read: "can't") be triggered in the first place - it's complete guess work. After all, why would the exception be honoured? That rule should already avoid the given request for a ...


2

You have AllowOverride All for <Directory /var/www/html/htc>. I suppose it's not allowed in /var/www/html. You could try: <Directory /var/www/html> AllowOverride All </Directory>


2

AllowOverride All is the directive that tells Apache to look in .htaccess files for more configuration. That vhost tells Apache to look for .htaccess files in /var/www/html/htc and deeper so it doesn't cover the .htaccess file in /var/www/html. One way to solve this would be to create another block like this (possibly in httpd.conf rather than this vhost if ...


0

This is how: Options -Indexes ServerSignature Off DirectoryIndex index.php RewriteEngine on RewriteRule ^ui(/)?$ app/dist/index.html [QSA,END,NC,L] RewriteRule ui/(.*) app/dist/$1 [QSA,END,NC,L] RewriteRule !(ui/.*) index.php [QSA,END,NC,L] Notice the END flag after every match. This flag is required to simulate the typical if-else syntax. But it is not ...


2

When you block access to all content, you also block access to the custom 403 error page....


Top 50 recent answers are included