Questions tagged [.htaccess]

Directory-level configuration file found mostly on Apache web servers

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Password protect a folder, also use IP white-list

I need to give access to a folder to specific IP addresses and also password protect the directory. The flow should be like this: If the folder is accessed from a white-listed IP then ask a password ...
-1
votes
0answers
10 views

Unable to process this request via mysite at this time. HTTP 500 ERROR [closed]

i'm trying to deploy my symfony 4 app but i get HTTP 500 ERROR error, i generated .htaccess with symfony/apache-pack. this what i have in my project public folder. DirectoryIndex index.php <...
0
votes
1answer
33 views

.htaccess - Simple <Directory> instruction not working

Scenario I'm trying to use a very simple <Directory> instruction in my .htaccess file and it's resulting in an apache error. Question How can I specify RewriteRules for different directories ...
0
votes
1answer
24 views

HSTS policy not preloaded on non www host

i am not very familiar with HSTS , but i try to implement it on my shared webhosting server. Seems i have gotten it to work on host with www. but not on apex host. Hardenize security audit flags it ...
0
votes
1answer
28 views

Two sites on the same server with unwanted redirection

I have two different sites domain1.com domain2.com Problem : I only can access domain2.com by using www.domain2.com If i try domain2.com it redirects to domain1.com. Configuration files: domain1....
0
votes
1answer
31 views

.htaccess simple <Files> not working

Scenario I'm simply trying to allow one php file through .htaccess password folder. Attempts so far my-special-file.php subfolder/my-special-file.php ./subfolder/my-special-file.php tried using a ....
0
votes
1answer
41 views

Cpanel NodeJS app displaying source code

I have set up nodeJS app on cpanel using cpanel nodeJS selector. Apps root directory is /home/userName/public_html/server. The app is working fine. Problem is if I send get request to example.com/...
-1
votes
1answer
80 views

How Do I Use .htaccess to Disguise Query Variables as “Virtual Directories”?

How would I go about having https://example.com/channels/[channel_name]/[video_id] appear in the address bar, but have my PHP script see https://example.com/channels?channel=[channel_name]&v=[...
0
votes
0answers
23 views

.htaccess redirect with no change of url isn't working

I am using [P] flag while redirecting. My old domain is pointing to new domain but with new domains URL. As far as I understand with [P] flag old domain URLshould be shown. I have checked ...
1
vote
1answer
36 views

Serve website from different directory based on URL string parameter

I would like to learn if I can serve the website from 2 different versions according to URL string parameters. Example: I have two installs on my server: example.com/website-1/ and example.com/...
0
votes
0answers
23 views

htaccess redirection duplicating /foo/foo/foo

I'm digging all resources but cannot find the solution. My website has multiple languages. It is basically adding ?lang=cn etc. and I'm turning it to a fake folder via htaccess with following code. ...
1
vote
2answers
64 views

RewriteRule (Reverse Proxy) of front page in htaccess not working

The following rule should target my front page (WordPress) to serve a different page instead. RewriteCond %{HTTP_HOST} ^example.com$ RewriteCond %{REQUEST_URI} ^($|\/$|\?|\/\?) RewriteRule ^(.*) ...
0
votes
1answer
20 views

apache .htaccess redirecting on one link, but not the other

I have this .htaccess file (this was the one that came with laravel. The only changes I made were to force https in the URL and the code shown below: <IfModule mod_rewrite.c> <IfModule ...
1
vote
1answer
13 views

Rewrite both links and images in .htaccess

How to make both links and images work in .htaccess this is what i want www.example.com/randomword --> /index/q1.php?encid=$1 www.example.com/anyname.jpg --> /index/img/q2.php?encid=$1 I tried ...
1
vote
1answer
62 views

Apache .htaccess: SSLRequireSSL produces HTTP 500 internal server error

I have an Apache web server hosted on one.com. The OpenSSL module is active and working. I can manipulate .htaccess and I see the reactions. I want to rely on SSL, and redirection by rewriting works ...
0
votes
0answers
16 views

allow some custom domain urls to point to personal webspace instead of github pages

I recently migrated from wordpress to github-pages where I host my personal website under a custom domain. Now I am trying to find out how I can allow certain urls in my website to not refer to github ...
0
votes
0answers
37 views

Prevent .pdf files from being downloading but allow to view in browser

I have tried to search better solution on Google and on Serverfault and found too many questions and answers, but none of them was my solution. (E.g. prevent the browser from downloading doc docx and ...
0
votes
1answer
109 views

(proxy_fcgi:error) AH01071: Got error 'Unable to open primary script:' (No such file or directory)

X-post from StackOverflow I've read countless forum posts about this but none of the answers seem to help my situation. Here's the log excerpt: [proxy_fcgi:error] [pid XXXX] [client redacted] ...
0
votes
0answers
29 views

Subdomain redirected to main domain

When creating my new vps server which contains apache, I added a domain and a sub domain but i'm confusing with a problem that the sub domain redirect me to main domain i thinks the problem comes from ...
0
votes
0answers
19 views

Htaccess rewrite a domain to another domain that uses laravel

I have a domain, with some query parameters as a path examp.le/7657 that I then want to map to wwww.myotherdomain/aPath/7657 This domain is served by laravel. So it already rewrites the public ...
1
vote
1answer
42 views

How do I restrict access to a specific URL?

I want to restrict access to a specific URL with .htaccess. I want to do this because the PHP/html file on the specific URL doesn't work as it should since the URL is wrong. I don't want anyone to be ...
1
vote
1answer
82 views

200 status for requests from IP not allowed by htaccess?

I have a Debian 9 server which is continually beaten on by bots. I check the access logs for 200s every day just to be sure my countermeasures are working. The logs are full of 403 status requests ...
0
votes
0answers
12 views

debian 9 linux is not loading my htaccess mod re-write rules

I have been struggling past 2 days trying to make a rewrite rule for my server it used to work great until I installed the SSL the SSL works well but it looks like the apache is not enabled because ...
0
votes
0answers
23 views

htaccess not redirecting images?

I'm trying to force all content to use HTTPS. I added the following rule to my htaccess: RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteRule ^.*$ https://%{HTTP_HOST}%{...
0
votes
0answers
31 views

RewriteCond pattern all match and logs showing the correct redirect link but website still not redirect [duplicate]

I have done N times of redirection and not successful for N times and now this is the most close to what I want but my website still wasn't redirect. I want my website to redirect from http+example....
0
votes
1answer
128 views

Relationship of ServerName, ServerAlias, host.file and how to define them in httpd-vhosts.conf

I wonder what is the relationship of ServerName & ServerAlias with host.file. As I know ServerName sets the hostname and port that the server uses to identify itself and ServerAlias is the ...
1
vote
1answer
131 views

How to set the http_referrer in a htaccess redirect?

I have a new domain for my site and want to forward the user to this new site. So I set up a simple redirect in my .htaccess file likeI have a new domain for my site and want to forward the user to ...
2
votes
3answers
168 views

Website redirection intermittently work in Firefox but not work at all in IE [duplicate]

After few try an error in website redirection, I manage to perform website redirection but it intermittently works in Firefox but not work at all in IE. I manage to clear all cache and retry in ...
0
votes
0answers
62 views

Remove unwanted dots from URL and don't stop checking htaccess

I am trying to remove unwanted dots from urls like: /en/example-.product I want to redirect this example link to: /en/example-product We cannot delete dots right before extensions of files, like ....
0
votes
0answers
12 views

Ignored htaccess passing from mod_php to php_fpm

I'm using a server with virtualmin... Used mod_php before now, but want to use php-fpm, but when this is enabled, .htaccess is ignored... Is htacess compatible with php-fpm? I have different website ...
0
votes
1answer
46 views

Restricting which ports accept connections (Debian 9 Stretch)

I am not a sysadmin but I am having to assume some duties in that realm. We have a Debian 9 Stretch server for development use. Linux xxxxxx 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u2 (2019-05-13) ...
1
vote
0answers
10 views

HTTP/2 Server Push Crossorigin not Working for Fonts in .htaccess

Further to my original question, preloading fonts using link headers in .htaccess, I've since been experimenting with HTTP/2 Server Push for more efficient caching. Server push works as expected for ...
0
votes
0answers
169 views

www+https redirection does not work even though redirection has been added in .htaccess file [duplicate]

I'm currently doing www+https redirection where I hope that my website able to redirect from http://example.com to https://www.example.com but it does not work even I have added redirection in ....
0
votes
1answer
30 views

[Wordpress][htaccess] Prevent not logged in users access to pdf, doc, docx, odt files

i have the following code on my htaccess, it works for all users but i want deny access only to not logged in Wordpress users, anyone can help me? Thanks! RewriteEngine on RewriteCond %{HTTP_REFERER}...
1
vote
1answer
37 views

Shared hosting returns 403 for no index file. Localhost returns 404. How?

My shared hosting service returns an apache 403 error when the user navigates to a folder containing no index.php My localhost returns an apache 404 error when the user navigates to the same folder ...
0
votes
0answers
25 views

Forcing HTTPS with .htaccess causes redirect loop in Laravel

I'm using Laravel 6.16 for a web-app. I've got a SSL certificate set up for the domain and I now need to force all request to use HTTPS protocol. The default .htaccess file has the following <...
4
votes
1answer
188 views

Preload Link using Files Directive in .htaccess

I'm currently preloading font files for one webpage on WordPress. So https://example.com not preloaded. https://example.com/test/ preloaded font file. This is what I've got in .htaccess. <Files "...
0
votes
1answer
28 views

Graceful conversion of access controll directives for Apache 2.4 (getting rid of mod_access_compat)

From personal experience and the documentation, there may be problems when mixing old and new access control directives in the configuration, e.g. old: Order deny,allow Deny from all # ... new: ...
0
votes
1answer
46 views

How resolve redirects issues [closed]

I am facing big issue after using cloudflare. I am not adeveloper .I am a simple person. How I can resolve this issue through htaccess file ?😕 My current htaccess file is here # BEGIN LSCACHE ## ...
0
votes
0answers
36 views

Safari and .htaccess .htpasswd leads to status 401

I have basic .htaccess authentication for my development server like this: AuthName "Developer Demo" AuthType Basic AuthUserFile /path/to/.htpasswd require valid-user It works fine in all browsers ...
0
votes
1answer
17 views

How to make Apache so that it does not use the .htaccess file

How can I make Apache so that it doesn't check for .htaccess files at all. Because, it is said that it reduces performance. Does it reduce performance if there is no .htaccess file in the directory ...
0
votes
2answers
78 views

htaccess rewrite for generated links

Hi, In the picture shows my htaccess rules, it blocks all requests not coming from this referer. But the application installed sends a confirmation email after booking with a URL ending like this: ...
1
vote
2answers
85 views

Redirecting old, specific filters to base url of category

Old version of filters and sorting was creating links like (explenation of every part is below - here is example for same category with different views and filters used): https://example.com/category-...
1
vote
1answer
47 views

.htaccess RewriteRule to nginx rewrite rule. How?

I have a remote apache server with php. The folder structure is: /html/api/v3/.htaccess /html/api/v3/getData.php The .htaccess contains: Options +FollowSymLinks RewriteEngine On RewriteRule ^get/...
0
votes
1answer
82 views

.htaccess to nginx rules

I've read lots of threads here and in other community forums, also tried some htaccess to nginx generators, but I'm struck with this. Thats my .htaccess <IfModule mod_rewrite.c> ...
1
vote
1answer
92 views

RewriteRule not working in root. Only in current folder

I have read articles for a couple hours now but since there is no console output to debug htaccess files I have reached total frustration. Ugly folder structure: /html/api/v2/estimates/index.php?...
0
votes
1answer
92 views

Apache htaccess multiple %{REQUEST_URI} and multiple %{REMOTE_ADDR}

Can someone help me make this functional? The goal is to provide a list of blacklisted paths ({REQUEST_URI}) and a list of whitelisted IPs ({REMOTE_ADDR}) and block accordingly. Currently the below ...
0
votes
0answers
26 views

Redirect Rule in my htaccess file

Scanners are picking this line up as threat. I didn't put it there and not sure what it means and google is not coming up with anything. RewriteRule ^(.*)--(conspecies)([0-9]+)-p([0-9]+)\/(.*)$ ?...
1
vote
1answer
30 views

htaccess subdirectory alias for root possible?

I moved a site that used to be at example.com/en/ to just example.com. however the graphics as still linked to /en/. What do I need to add to my .htaccess to make the site serve files under /en/ as ...
1
vote
1answer
36 views

.htaccess write commands if hostname equals to

It is possible write any kind of condition (IF) in .htaccess to apply some specific actions ? #if hostname = xxx then php_flag display_errors on php_flag display_startup_errors ...

1
2 3 4 5
51