Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The Apache HTTP Server is an Open Source Web server, which originated from a series of patches to the NCSA HTTPd. Apache is the world's most popular Web server, which is run on 54.90% of all Web servers according to the Netcraft survey conducted July 2010.

1
vote
1answer
49 views

RewriteEngine .htaccess rules end up redirecting to example.net/https:/example.net

I'm starting to learn about the Apache .htaccess and I have some issues in my website... RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{...
4
votes
0answers
51 views

Will forbidding “bad bot” user agents via .htaccess add a layer of protection against email address scraping beyond the existing captcha?

I was reviewing the security/protection measures for the websites I manage (one is for a small consulting firm, the other for a not-for-profit art association), and I came across the topic of bad-bot ...
1
vote
2answers
31 views

Rewriting URL of WordPress in a Subdirectory

I am renting some webspace and a domain from BlueHost.com on which I run a WordPress site. Let's call it example.com. WordPress is installed in the root folder. As I can run multiple sites on this ...
1
vote
0answers
15 views

Allow our own systems to use an API and restrict it from the general internet without using authentication

I have an Apache server which is reverse proxy'd to some Java container. In Java container there is an API that we don't want internet to see but expect our own systems to use it without any ...
0
votes
1answer
51 views

How to migrate from HTTP and HTTPS old sub domain to HTTPS root new domain in htaccess with least SEO risks?

Looking for the best site migration strategy for SEO, which consider these specific combinations of elements and challenges: *note: site is in Wordpress. Htaccess redirect code to go from sub ...
1
vote
1answer
30 views

How to remove port number from the URL?

I need a help for the remove port number from the URL. I host a site on VPS using xampp virtual host. Everything is working perfectly,but cant access domain without port number EX: www.example.com:...
2
votes
1answer
44 views

Open website with subdirectory blocked by ip address?

I'm trying to block a subdirectory on my website that is open to the public. Nothing I've tried has been successful. Is this section from my conf enough to determine what's wrong? This is on Apache 2....
5
votes
2answers
41 views

In .htaccess files, is there any difference at all between “!=on” and “off”

I’m trying to better understand Apache’s use of a binary attribute. In an .htaccess file with the code # Check if HTTPS is 𝗻𝗼𝘁 𝗼𝗻 RewriteCond %{HTTPS} !=on Is there more processing occurring&#...
3
votes
2answers
49 views

How to use X-Robots-Tag to noindex all subdomains (save specific exceptions)?

Google's Robots meta tag and X-Robots-Tag HTTP header specifications page (Practical implementation of X-Robots-Tag with Apache section) gives an example of noindexing certain filetypes, ie: <...
0
votes
0answers
204 views

Running test Python script under Apache 2.4 gives error “end of script output before headers”

I am trying to get a simple web service running on my local computer. In my cgi-bin directory in the Apache24 folder I added an empty file called pywps.cgi with the following content #!C:\ProgramData\...
0
votes
1answer
24 views

.htaccess rewrite rules working on Mac Apache 2.2 but not on CentOS Apache 2.4

I've run into an issue when moving from a test server to a production server. I have a set of .htaccess rules in a file in the public_html site root: #Root directory htaccess RewriteEngine On # ...
0
votes
0answers
37 views

How to continue or restart a failed Certbot transaction

We run a web server for a free/open source project on a CentOS 7 VM. We have Apache 2.4 installed from Red Hat's Software Collections (SCL). We also installed EFF's Certbot from EPEL to manage HTTPS ...
3
votes
1answer
108 views

421 Misdirected Request on Shared Host

I am on a shared host (Apache) and am receiving little help resolving this issue. I have a main domain https://www.waldorfteacherresources.com and I have set up two cookieless domains: static....
1
vote
1answer
77 views

Subdomains getting redirected to root directory of virtualhost

I'm trying to have 3 different domains and subdomains on my VPS: pd.example.com intranet.example.com example.com I have configured them, but for some reason each subdomain is getting redirected to ...
1
vote
1answer
95 views

403 Forbidden error was encountered while trying to use an ErrorDocument

I am trying to configure Apache HTTP Server by running a web application using Apache's mod_fgcid, a module for FastCGI. I have put a configuration file which allows the interface of my app to be ...
2
votes
1answer
10 views

How to define RewriteRule to skip parameter in uri

I heve the following rule: RewriteRule ^/shop$ https://www.example.com/category the rule is working as expected with one exception: if in url there are parameter following the shop path, for example:...
0
votes
0answers
34 views

How to configure apache2 mod_wsgi to deploy Flask application?

I currently have a server with Debian 9, which has a LAMP package installed. I have been asked to deploy an application using Flask, he managed to deploy it but from the console using python app.py, ...
0
votes
0answers
19 views

A ghost is propagating an Apache redirect

I have a httpd.conf file with some redirects like this: <Directory "${SRVROOT}/htdocs"> Options Indexes FollowSymLinks ExecCGI AllowOverride None Require all granted Redirect ...
2
votes
0answers
19 views

Change default index.html page of a subdomain in directadmin

When I create a new subdomain in direct admin panel it gets a default placeholder page saying something between the lines "welcome, the page is under construction" or whatever. I've looked online ...
1
vote
1answer
51 views

Apache rewrite existing rewritten url [closed]

I know how to create rewrite rules in Apache but what I don't know is how to rewrite a previously rewritten url. This is an old URL /boats-for-sale/fairline-squadron-55/1280 and I need to redirect ...
1
vote
0answers
141 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 ...
0
votes
0answers
25 views

Accessing pdf using iframe on different IP

I have WAMP installed in a machine in IP address I just call as IP1. I can access the PDF files in this IP1 inside the www folders using iframe with no problem. But there are other PDF files inside ...
2
votes
2answers
178 views

How is it best to redirect http to https in cPanel?

I am setting up a new site on a domain that has an SSL certificate. The DNS is all configured correctly and I can access the site on either http://example.com or https://example.com URLs. Currently, ...
1
vote
1answer
69 views

Apache2: create a unique identifier that is actually base64 encoded

Apache has a module called mod_unique_id that generates a unique environment variable (UNIQUE_ID) that is unique across all requests. However, its encoding is over the range [A-Za-z0-9@-] instead of ...
0
votes
0answers
13 views

How to find shared hosting with two capabilities [duplicate]

1) Apache server 2.4.33 or later. 2) Able to give a programmer access to just one domain, even tho I host more than one with the hosting service. 3) Shared hosting, not VPS. How do I find such a host?...
0
votes
0answers
29 views

How do I create a custom Apache log (with just htaccess files) that logs filenames (and paths)?

I have 1and1 shared hosting (for better or worse) and Apache configuration is done via htaccess files - no access to configuration files is provided. I want to create a custom log to log accesses to ...
5
votes
3answers
82 views

What directory structure is typically used for domains and subdomains on a Linux Apache server

Although I've used MAMP and AMPPS before on OSX, simply for testing purposes, this question is about actual production websites on Apache servers. If I had the domain name www.example.com - if this ...
0
votes
1answer
146 views

HTTPS - HTTP communication on the same server

There is a server. On the server is apache. Apache has certificates. On the apache is a website - client, thanks to certificates the client is accessible by https://example.com/~path. The client is ...
1
vote
1answer
24 views

How do I log in into Apache web server on Ubuntu from Windows?

I've been given a username and password for an Apache server, that runs on Ubuntu, and belongs to my professor. I do not know how to connect to the server from my machine(windows), and run scripts ...
4
votes
2answers
255 views

Rewrite all URLs within subdirectory to index.html so JavaScript can use the path

I have a part of domain example.com/~mypart. In that folder is index.html. If I visit example.com/~mypart/something I get a "Not Found" error. I want every address with some string after example.com/...
1
vote
0answers
66 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 ...
2
votes
1answer
34 views

Redirecting from one page to another page on my website causes 404 error after using .htaccess file

Currently I'm working on a PHP blog. Where I have used an .htaccess file to get a clean URL, here is the code: RewriteEngine On RewriteCond %{HTTPS} !=off RewriteCond %{HTTP_HOST} ^example\.com$ ...
0
votes
1answer
60 views

Why would a user agent string contain both “Samsung” and “AppleWebKit”?

Investigating an issue on a website, I see an entry in the Apache log with this User Agent setting: Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG SM-G955U Build/R16NW) AppleWebKit/537.36 (KHTML, like ...
1
vote
0answers
34 views

What command will restart Apache from a PuTTY terminal to manage a cPanel server?

Once when we logged on to the server via putty terminal with authorised SSH credentials What is the command given to the putty terminal for restarting the Apache server after loading some extensions? ...
1
vote
1answer
331 views

Why gzip compression not working on font file?

Resources on my site are compressed before sending to client browser, except fonts, I've checked everything but couldn't find anything wrong. Here is my CSS, one of the fonts: @font-face { font-...
1
vote
1answer
79 views

HSTS implementation when using www.TLD

Been looking at implementing HSTS in to one of our sites, hoping to validate it on the preload list. But I can't get my head around how it works with the www. Subdomain. Our site forces secure www....
1
vote
0answers
28 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 ...
2
votes
1answer
68 views

Googlebot URLencoding longtail URLs which is causing server errors

My Google search traffic has been growing consistently for months without any hiccups. Then a few days ago, Google dropped my traffic by about 80% in one day. The traffic would then later rebound ...
1
vote
0answers
116 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
2answers
187 views

IP address redirect works, Domain redirect does not

Similiar to issue found here. Running debian, apache2, trying to redirect example.org.com to example.org.com/aplication/calculator. I have enabled mod_rewrite hence why IP redirect works. However if ...
0
votes
0answers
100 views

localhost/phpmyadmin - 404 error MacOSx Sierra

I'm setting up a php project on my machine's loalhost. This part is working fine, and it's loading the 'index.php' correctly when visiting 'http://localhost'. However, visiting 'http://localhost/...
1
vote
1answer
74 views

Can't include file with php due wrong permissions on local server

I have two computer I wish to work to create websites, one is an imac with osx 10.13.14 and the other is a ubuntu 16.04 that I use as server with Apache. I need to be able to edit files in both ...
3
votes
1answer
128 views

Possible to match special characters with mod_alias and `Redirect` directive?

I’m using Apache 2.4.6 with mod_alias and have a website which is receiving traffic from a link on another website that I have no control over. The other site’s link is poorly formed and it causes ...
0
votes
2answers
73 views

General questions on operation of SSL secured sites [closed]

I am trying to get some understanding on differences between unsecured (http:// accessed) and SSL secured (https://) websites on Apache servers. So I am not trying to solve a specific problem right ...
2
votes
0answers
183 views

503 service unavailable error for ALL files except PHP files when using Apache virtual hosts

Apache 2.4/ PHP 7.0 Virtual hosts setup working correctly. There are no issues loading JPG files when pointing directly to the server using IP address. <VirtualHost *:80> ServerName example....
1
vote
0answers
69 views

Get CPU load statistic from apache access log [closed]

I have apache access log, i want to parse it and to get top CPU load pages and agents. Does somebody know good script for this? My log line has this format: host.ru 11.11.111.11 - - [01/Apr/2018:11:...
4
votes
1answer
432 views

How to add force https to htaccess file RewriteRule with _route_=$1

I inherited support for an Opencart 1.5 site which needs to have SSL enabled. I've edited the config.php files in / and admin/ and adding https:// to the URL is working in the browser and links are ...
1
vote
1answer
427 views

Forcing trailing slash at end of “fake” folders

The working codes that I've found here most put a slash in everything. I just need force trailing slash in these "fake dirs" (that are part of my rewriting scheme (only directories)) and keep ...
2
votes
3answers
45 views

Does redirecting http to https using RewriteEngine preserve my site's link equity?

Running an Apache web server, if I use an .htaccess file to redirect all my http:// traffic to https:// using something like RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{...
2
votes
1answer
244 views

Deny access to one of two sites using the same .htaccess

I need to set up my .htaccess file to deny access to the site if they are accessing the staging.example.com. I have a Magento 2 store and have set up deployment using Capistrano, which will be ...