Questions tagged [.htaccess]

Directory-level configuration file found mostly on Apache web servers

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

Files and Blockchain connected?

Why would Azure be trying to download my files when I have no idea what it is. My phone constantly hacked and I think they want Blockchain password. How are they connected what does this have to do ...
Renee's user avatar
  • 1
0 votes
0 answers
15 views

I want to add a custom 404 to all my URLs following a relevant pattern using .htaccess file

Hello, Google is currently indexing query string URLs of my website. Google has currently indexed almost 112k URLs that all of are duplicate versions of other URLs causing my website to slow down and ...
mehtab fatima's user avatar
1 vote
1 answer
44 views

htaccess - Generate ALLOW rule dynamically from external file

Can Htaccess set variables by external files as values? I would like to ALLOW all IPs that are listed in a txt file located on the server. This txt file is auto generated via script by our systems ...
MastaP's user avatar
  • 111
0 votes
1 answer
25 views

Can I set my own SSL certificate via .htaccess file in a shared web server?

I am hosted in a shared web (apache) server in a subdomain. I don't have access to any panel, only sshfs. The problem is that the host (lazy), does not issues / uses SSL certificates. I issued my own (...
krg's user avatar
  • 3
0 votes
0 answers
23 views

Redirect utm_source for multilingual web page

I have https://www.example.com/page-name/?utm_source=dlvr.it&utm_medium=twitter I have added the following code in the .htaccess file and redirected it to https://www.example.com/page-name/. ...
Md Mosharef Hossain's user avatar
1 vote
1 answer
30 views

What determines the name of Apache PHP Handlers?

When configuring an Apache server to use a Handler to run PHP code, I'm familiar with adding a line similar to below in httpd.conf or .htaccess: AddHandler application/x-httpd-php81 .php This tells ...
frumious's user avatar
  • 123
1 vote
0 answers
18 views

How to redirect all pages that contain an specific word using the .htaccess file

I have a bunch of indexed pages that start with the same word and they are all 404 so I want to redirect them all to the homepage of the site. The server is Apache, so I would like to use the ....
Pol Senserrich's user avatar
1 vote
1 answer
123 views

how to run next.js using NODE and react.js at the same time on apache server

I have to run 2 different apps on the same domain at the same time. I want to forward all requests to localhost:3000, if url contains /presscenter, if not, default should be my react.js application. ...
Y U K I M U R A's user avatar
0 votes
0 answers
46 views

Block access to xmlrpc symlink file with htaccess

I have a WordPress site I am versioning with the help of symbolic links on an Apache/2.4.52 (Ubuntu) server with Nginx as a reverse proxy. The directory structure is as follows: example.com wp-admin ...
dctech's user avatar
  • 1
0 votes
0 answers
75 views

REQENV and SETIF If statement isn't evaluating correctly

....or it is and I've missed something. So I have a website that can only be accessed via certain IPs. A new development is that I want some of the pages on the site to be open and freely available to ...
Richard Askew's user avatar
1 vote
1 answer
212 views

Default WordPress .htaccess rewrites causes default server page to load due to no default index page present for the root URL

I could really do with some help here please. I know this is a WordPress issue now through testing. If I allow .htaccess to process rewrites on my Wordpress sites by adding AllowOverride FileInfo to ...
J O's user avatar
  • 21
1 vote
1 answer
69 views

How to replace custom url old domain to new domain with .htaccess

How to replace all url entire website with new domain and new permalink? I have 5k url to replace at my site. Example : Current URL: oldomain.com/2020/12/data-raid-4963.html Replace To: sub.newdomain....
Maone van Cobain's user avatar
0 votes
0 answers
21 views

How to write parameter URL in .htacess Rewrite

I want to point this URL in .htaccess: http://www.example.com/furniture/chair/foldingchair to http://www.example.com/products.asp?catID=1&SubID=2&SubCatID=3 where catID=1 = furniture SubID=...
Khan101's user avatar
1 vote
1 answer
69 views

Restrict access to specific http_host with apache 2.4.x .htaccess

I'm wondering if anyone knows how to approach this predicament I am facing using .htaccess. I have a website that is accessible using 2 different domains. For one of the domains, I only want the ...
Jim Smith's user avatar
0 votes
1 answer
238 views

htaccess: I need urgent help to remove %3f behind via form submit query generated urls

3 years with hosting at a2hosting. Today I noticed that every form query ends with %3f at the end of the generated url, which makes a 404. This happened suddenly. This is my htaccess code that works ...
Sharon Creech's user avatar
0 votes
0 answers
68 views

redirect request to folder except for specific request

I have this htaccess that redirects all requests to a folder (public folder for laravel framework) and now I have a staging app that is clone from the main application e.g. mydomain.com/staging and I ...
Juliver Galleto's user avatar
0 votes
0 answers
36 views

deny direct access to folder but allow rewrite redirection

I have a question about htaccess. I have a rather complex website structure on the server and I use htaccess for redirection. the site structure is as follows web/project/test_project/ ├─ admin/ ├─ ...
Jan Hrabovsky's user avatar
1 vote
1 answer
125 views

Trapping misformatted paths to Redirect to 404 instead of returning 403

Owing to an error long ago our company web site has been serving image URLs containing a significant amount of white space. E.g. http://www.example.com/ /assets/ProductPhotos/...
AristotleO's user avatar
1 vote
1 answer
92 views

how to redirect a web page based on domain name using .htaccess

At a site serving multiple domains (example.com, example.org, etc.), we would like to redirect a page depending on the domain: https://www.example.com/page1 => https://www.example.com/page2 https://...
vision's user avatar
  • 13
0 votes
0 answers
91 views

Apache is not reading .htaccess file

I'm having trouble getting an .htaccess file to work on my self-hosted server. I'm trying to redirect all visitors to HTTPS and non-www using the following directives: RewriteEngine On RewriteCond %{...
RAD6000's user avatar
  • 113
0 votes
0 answers
68 views

Apache htaccess denying requests for iOS connections when proper headers are passed

In my the directory for my api, my htaccess file has the following lines: Header always set Access-Control-Allow-Origin "*" Header always set Access-Control-Allow-Methods "GET, POST, ...
rolinger's user avatar
  • 103
0 votes
0 answers
51 views

Serve mixed case files case-insensitive on Linux Apache without mod_speling?

On my media subdomain (nice separation of concerns, also for rulesets) I have files which are in Mixed-Case-intentionally (for maximum semantics, also for downloads) which I want to serve case-...
porg's user avatar
  • 143
0 votes
1 answer
55 views

Redirect rules for multiple enviroments

I have written a set of rules for 3 different environments on the same server. In a nutshell I would redirect the users to the Dev, Stage and Prod single sites. Also enforce https and www for the ...
Manoxs's user avatar
  • 1
1 vote
0 answers
45 views

Apache2: mod_ratelimit only allowing half the speed

I'm trying to limit the file download speed in a directory I've got the following .htaccess <IfModule ratelimit_module> SetOutputFilter RATE_LIMIT SetEnv rate-limit 4096 </IfModule>...
DrDino's user avatar
  • 11
0 votes
0 answers
71 views

AlmaLinux HTTPD will not recognize the error with .htaccess

Product version: Plesk Obsidian 18.0.47.5 OS version: AlmaLinux 8.7 x86_64 The problem is Apache / HTTPD would not recognize to error its .htaccess from when editing the file at AllowOverride None to ...
Saya Kisaragi's user avatar
1 vote
0 answers
83 views

Apache 2.4 "client denied by server configuration" caused by Require expr - even though the request succeeds

Our apache error log is littered with messages saying client denied by server configuration, even though the htaccess configuration is working as intended. Here is the relevant bit of the htaccess: ...
Jonathan's user avatar
  • 111
1 vote
1 answer
33 views

Apache ToLower on all Wordpress pages (not PDF/CSS/JS)

I'm having issues performing a 301 redirection of URLs that contain capitals to lowercase, excluding static files (PDF/CSS/JS/JPEG/JPG/PNG/WEBP...etc). For example: https://www.example.com/Page/ would ...
PublicDisplayName's user avatar
0 votes
1 answer
250 views

How to redirect all pages that contain a specific word using the .htaccess file

I have a bunch of indexed pages that start with the same word and they are all 404 so I want to redirect them all to the homepage of the site. The server is Apache, so I would like to use the ....
Petar Cvetic's user avatar
1 vote
1 answer
237 views

htaccess redirect all subpages to parent page except for some parent pages

I want to match all subpages to parent pages, am using wordpress, will that mess up the images and wordpress files?, And I have tags and categories, and I want to exclude them from this rule. ...
mutamilvativu's user avatar
1 vote
1 answer
213 views

Redirect all URLs ending in ".-detail" to remove the dot

I have a rather odd situation where our old URLs are ending in .-detail and need changing to just -detail. For example: example.com/product.-detail needs changing to example.com/product-detail In ...
markbarabus's user avatar
0 votes
0 answers
19 views

Redirecting all 404s to a custom page using Nginx $mod_rewrites

How to redirect all 404s and any random characters after my domain all to the main domain? I'm using $mod_rewrites = [ code because .htaccess and other things are not working. For Example : From this ...
Adam's user avatar
  • 1
1 vote
1 answer
234 views

Apache htaccess ruleset: Try request as: 1) file as-is 2) file + .html suffix 3) DirectoryIndex 4) Else to index.php CMS router

I'd like to express this ruleset If the request is /hello then try the following in the given order: /hello — File of that name exists (file without file extension). Edit: Not a necessity. Only a ...
porg's user avatar
  • 143
2 votes
2 answers
2k views

.htaccess - Redirect all URLs with one exception

I want to redirect all URLs from one domain to another. Some of the old URLs have new counterparts with specific pages to redirect to. All other URLs should redirect to the homepage of the new domain. ...
Cray's user avatar
  • 135
0 votes
2 answers
223 views

HTTP 403 with CloudFlare

I've added my site to CloudFlare. I'm trying to allow requests to only come in through CloudFlare's network, and reject all others. When I add the following to my .htaccess, I get HTTP 403 Forbidden. #...
anxiety's user avatar
2 votes
0 answers
224 views

Htaccess to Nginx with pre-configured options

I have a website that run under nginx, with directives applied by Cloudpanel and i want to add my crm on it, the crm have 2 .htaccess file, one in the root folder and one in the /public folder. I'm ...
johnnydeppa's user avatar
1 vote
1 answer
235 views

htaccess: 301 redirect defined URLs to new domain and catch all redirect the rest

I want to redirect some URLs from an old domain to new versions on a new domain. The old domain uses the www. subdomain and SSL. For example: olddomain.com/audi -> newdomain.com/cars/audi ...
Cray's user avatar
  • 135
1 vote
1 answer
382 views

Redirect www to non www and redirect to index.php

my www folder has the following .htaccess RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] my api folder (within the ...
2WFR's user avatar
  • 135
1 vote
1 answer
214 views

How do I add the __Secure prefix in this .htaccess line?

Sorry, I'm not an Apache expert. I need to add the __Secure prefix to this htaccess line: Header onsuccess edit Set-Cookie (.*) "$1; SameSite=Strict; Secure" is this possible? How?
Life after Guest's user avatar
-1 votes
1 answer
53 views

I'm in trouble with .htaccess RewriteRule

I'm trying make to a social platform like Instagram or Facebook and I wanna to show users, username like that examplesite.com/usernamehere so in the url. I'd been researching how to do this and I ...
Zafer İnci's user avatar
1 vote
1 answer
86 views

How Can We Do 301 Redirect Of Over 200 Pages To Corresponding 200 Pages At New Location?

I need help and need it fast. We recently migrated a subdomain to integrate with the domain. Eg. https://blog.example.com to https://www.example.com/blog https://blog.example.com has a ton of traffic ...
user18571's user avatar
1 vote
3 answers
88 views

Apache: How to "hide" a subdomain but serve over https

I will freely admit my ignorance - or perhaps enough knowledge to be dangerous. I have a subdomain http://db.<mydomain>.com that serves the phpMyAdmin utility. It's currently in a directory with ...
Eddie Rowe's user avatar
0 votes
0 answers
710 views

.htaccess for Wordpress in a subfolder

I have a setup where a static website sits in the root folder and Wordpress is located in a subfolder. So I need to rewrite all requests to index.html while all Wordpress-related requests should go to ...
IDSK's user avatar
  • 1
0 votes
0 answers
16 views

htaccess rewrite rule not applied when in A2HS/PWA mode?

My symfony5 application serves up a microsoft azure SSO link up front, and it works great through the browser. When a user opts to add my app to their iOS homescareen however, there is a problem. Here ...
Matt Welander's user avatar
2 votes
2 answers
511 views

How can I remove 2 separate portions of a URL using mod_rewrite?

I have this unfortunate URL: dom.tld/library/Photography/index.php?cmd=image&sfpg=2021/*IMG_3468.jpg dom.tld/library/Photography/index.php?sfpg=2021/* This should look like this dom.tld/library/...
Apver2t5kM's user avatar
1 vote
1 answer
207 views

Apache mod_rewrite RewriteRule loops despite L flag

Apache/2.4.54. I am trying to achieve that similar URLs (e.g. "/anystuff.htm") are externally redirected to "/something" which internally is "something.html". But the ...
handle's user avatar
  • 113
1 vote
0 answers
11 views

Setup Authentication for landingpage fetching data from proxy via access restriction?

Imagine the scenario where you have a client who wants you to implement calls to an external API on a landingpage that you've setup for them. The external API works based on a contract and API keys ...
DevelJoe's user avatar
  • 145
0 votes
0 answers
93 views

Server 500 error caused by mod_rewrite with Apache

So i've been trying to get this particular script installer to run, and I cannot seem to figure out why it won't process the rewrites properly. In my .htaccess file within the root directory, I have ...
Eric K.'s user avatar
  • 101
0 votes
0 answers
127 views

Nginx rewrite - not working - convert from htaccess

I have a .htaccess file and I'm trying to convert it to an NGINX URL Rewrite configuration. Unfortunately, none of the available converters help. Every time I get either a 403 error or 'No input file ...
Przemo Memo's user avatar
0 votes
0 answers
40 views

How to server index.php from different directory through .htaccess?

I am working on a project which is in Yii2. I have to integrate swagger UI for API documentation. My current directory structure: This is what the .htaccess looks like: RewriteEngine on RewriteCond %{...
Paresh Maheshwari's user avatar
0 votes
0 answers
136 views

Migrating Wordpress to IIS convert .htacces to web.config

An outside company is making a website, they are working on LAMP, there is an IIS server at our place so I have to prepare this server for the implementation. Preliminarily it has been prepared (I ...
Raloseq's user avatar

1
2 3 4 5
56