Questions tagged [apache]

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.

Filter by
Sorted by
Tagged with
1
vote
1answer
26 views

How to point a domain name to a subfolder

I have a working website: https://www.example.com It is a bit old, and now I want to make a new website. I don't want to make it on localhost but directly on the web. I was thinking to make the ...
0
votes
1answer
25 views

Restricting access to a website without using sessions or IP whitelisting? [duplicate]

I want to restrict access to a private website that needs to be accessible to multiple people. In the event the website has public and private areas, a login to a user session is the usual solution. ...
5
votes
1answer
756 views

Redirect percent encoded URL in .htaccess

Suppose I have the following URL: http://example.com/%D8%B3%DB%8C%D8%B3%D8%AA%D9%85-rss-%D8%B3%D8%A7%DB%8C%D8%AA-%D8%A8%D9%87%DB%8C%D9%86%D9%87-%D8%B4%D8%AF/ How can I redirect this to http://www....
9
votes
2answers
2k views

HSTS Preload section on .htaccess

Recently having moved a site to SSL, I looked into enforcing HSTS for eventual preload. The syntax is approved and the Chrome List allows it to be OK. However, not being a coder at all, a slight ...
5
votes
4answers
3k views

SSLCipherSuite settings not taking effect from Apache ssl.conf, only when duplicated in each virtual host

I have an odd issue. The SSLProtocol config is getting applied in my ssl.conf file but the SSLCipherSuite config is not. I have tested this by changing each option and running scan with Qualys SSL ...
2
votes
1answer
25 views

htaccess - RewriteCond is met, but RewriteRule doesn't run

I am trying to match both a filename and querystring in my .htaccess file. When using an online testing tool (this one), it tells me that the conditions are being met, but the following rule doesn't ...
2
votes
1answer
4k views

Virtualhost config: routing and wildcard usage

My VirtualHost config is below: <VirtualHost *:80> ServerName www.example.com ServerAlias example.com DocumentRoot /var/www/example/html </VirtualHost> I ...
2
votes
1answer
52 views

Content that should be protected is served without authentication intermittently

Our website hosting is with a shared hosting provider. The only configuration we can make is through .htaccess files, we can't touch the apache configuration files that are sourced when apache first ...
0
votes
0answers
17 views

Rewrite local file links

I have *.html files accessible through file:// protocol in browser. Within these files are links to resources, like <img src="file:///c:/users[...]pic.jpg">. This all works fine for ...
1
vote
1answer
47 views

PHP file not running using XAMPP [closed]

I recently installed XAMPP v.3.2.2. I have since been trying to test if PHP is properly configured by Apache. But I keep getting this error every time I try to run any PHP file. I have stored the ...
3
votes
2answers
55 views

Is it possible to display the path with an Apache index listing with a custom header?

I've set up a download site using Apache's index listing feature and a custom header: Options +Indexes HeaderName /index_header.html While the default header displays the path ("Index of ...&...
2
votes
1answer
48 views

Block access to multiple files with .htaccess - RewriteRule and FilesMatch fail

I am trying to block access to specific files. Neither the RewriteRule or FilesMatch rules I have tried work on the live server, it serves the files as normal with status 200 OK (I'm expecting 404 ...
2
votes
1answer
52 views

Redirect requests on alternate port for Apache virtual host

I have Apache server where I make my LoadBalancer for my application sereres through proxy and balancermember. Some of my clients come from legacy access, they use a port in the URL example.com:2030 ...
1
vote
1answer
13k 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
58 views

Can mod_security run in a “permissive” mode?

SELinux has a "permissive" mode where violations are logged but not enforced, thus allowing for debugging and troubleshooting before locking the system down. Is there such a feature in ...
0
votes
0answers
22 views

Pointing one subdomain to another subdomain of different domain for a website hosted in aws

I am trying to point a subdomain app.domain1.com to app.domain2.com, where I want to serve the content of domain2 without changing the URL domain1 in the browser address bar. I have added a cname ...
1
vote
1answer
56 views

Flush cached selector in Adobe Experience Manager without flushing entire directory

How can I use selector based cache flushing in Adobe Experience Manager? http://example.com/content/myapp/us/en.child1.xml http://example.com/content/myapp/us/en.child2.xml Lets say,we have xml's ...
2
votes
2answers
62 views

Do short URLs obligate 301 redirects?

Some content management systems such as WordPress and Drupal have Short URLs by default (if the webserver allows it), but at least one other --- MediaWiki, doesn't. Before I continue with the process ...
1
vote
1answer
92 views

A modern global rewrite command for HTTPS websites without cname (www.) at all

I host a MediaWiki website on a shared server with Apache, MySQL and PHP. Up until today I used a CDN to deliver that website's content --- which required redirecting each webpage to a www. including ...
11
votes
3answers
27k views

How can I use robots.txt to disallow subdomain only?

My code base is shared between several environments (live, staging, dev) & sub-domains (staging.example, dev.example, etc.) and only two should be allowed to be crawled (ie. www.example and ...
0
votes
1answer
31 views

Can I ban IP based on page GET then instant POST? (Spambots)

While there are lots of rules to id and ban spambots, e.g., Fail2Ban rules, it's always a cat-and-mouse chase. Nothing's perfect. Then it hit me. The one thing they always do is get a page, then ...
1
vote
1answer
34 views

Safe way to block unwanted bots without potential impact on good ones

Currently, I have blocked several bots in htaccess (apache 2.4) like this. (Have used imaginary bot names in the below example.) SetEnvIfNoCase User-Agent .*abcbot.* bad_bot SetEnvIfNoCase User-Agent ....
1
vote
1answer
41 views

Can I use the .htaccess file or another solution to address www and non-www duplicate content issues?

Ahrefs is returning a series of duplicate content URLs for my own website i've asked them about and which they've said needs to be addressed on the CMS side, and which they cannot help with. The ...
3
votes
1answer
78 views

Redirect URL ending in certain `variable=value` query string, to `URL?variable` (i.e., strip `=value`)

I'm trying to create a 301-rewrite for URLs ending with ?amp=1 to nearly the same URL and query string, just stripping the value (=1). Examples: https://example.com/?amp=1 should redirect to https://...
1
vote
1answer
92 views

Remove PHP extension from URLs such that the URLs work with or without a trailing slash

My directory structure is - Assets - Dashboard - index.php - account.php index.php about.php verify.php What I basically want it to be: Remove the .php extension for example http://example.org/...
11
votes
3answers
8k views

When is the leading slash (/) needed in mod_rewrite patterns?

Here is an example from the Apache documentation for enforcing canonical hostnames: RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/?(.*) http://www....
1
vote
1answer
42 views

How can I run commands in my system using a website running on my local server?

I set up an Apache server on my system. I want to run commands and files using the website running on my local system. How do I trigger a file running using browser? What i want to do: I have a file ...
3
votes
1answer
53 views

IIS rewrite rules for SEO friendly URLs don't work in .htaccess for Apache

I'm using a Pi 3 for the Apache server but I can't figure out how to setup .htaccess. Previously I used IIS with which it is easy to implement SEO-friendly URLs. Linux .htaccess is very different and ...
1
vote
2answers
64 views

How to remove all .html extensions from all pages of site running under Apache?

On a shared hosting environment based on CentOS-Bash, Apache (with Nginx as a "reverse proxy"), PHP and MySQL I host a MediaWiki website. Normally, no webpage has a .html extension. I have ...
1
vote
1answer
67 views

How do I make my home web server public when port 80 is forwarded with my CenturyLink router?

I have the latest version of Apache Lounge, and I want to make it accessible to the other people. My Website IP is 192.168.0.61, and in httpd.conf these are the settings I added Listen 192.168.0.61:80 ...
1
vote
0answers
50 views

SEO - Google select a another domain at canonical url

I have a problem with my domain for selected canonical url by google. I have a vps for my website with apache. I created a redirect for website ip, but some domains have my ip in DNS and redirect to ...
3
votes
2answers
349 views

Is it possible to check the case on Apache redirects or aliases?

I have a big website (15,000 pages) with a log list of redirects (about 800) that have been used in marketing pieces for years. My Apache server has been running mod_rewrite for the past 10 years or ...
1
vote
0answers
34 views

What can be a reason of a "The requested URL / was not found on this server" error in case of an addon domain? [closed]

Let's say I have a site hosted on a.example.com. I'm adding an addon domain to the server (shared hosting): b.example.com and point this domain to the server IP address. Visiting b.example.com ...
2
votes
0answers
50 views

Prevent search engines from crawling and indexing all domains and subdomains set up under an Apache server

My company is renting a CentOS server, with one main domain and ~30 subdomains (the number varies, but it's usually around 30) hosted on it. The subdomains themselves are used for various purposes (...
2
votes
0answers
50 views

How to customize/change 3xx status pages in Apache?

How can I customize the 3xx status pages Apache? I am able to customize the 4xx and 5xx error pages using the ErrorDocument directive. I have tried the same for the 3xx status pages, but no good. I am ...
8
votes
3answers
37k views

How to redirect / convert any URL to lowercase?

I am using: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteRule (.*) http://example.com/$1 [L,R=301] </...
3
votes
1answer
2k views

Htaccess, deny any request not coming from a form in the website

I'm not an .htaccess expert, so I beg your pardon for the basic question. In a website I'm working on there's a form. The action URL of the form is a file placed in the root of the website. I want ...
3
votes
1answer
424 views

Can a reverse-proxy be used to show content from a domain with Windows server on another domain with a Linux server?

I have a website that was developed and is hosted on a Windows server (Server A). We want to have these Windows hosted pages to show up on another website that is hosted on a Linux server (Server B). ...
2
votes
1answer
766 views

Redirect from index.html to its directory using .htaccess?

For each page of my website, it is named index.html and stored inside a folder of the name of the page. example.com/ serves example.com/index.html example.com/about/ serves example.com/about/index....
1
vote
1answer
23 views

Subdomain rewrites without using certs that don't support sub domain affecting

I am using LetsEncrypt to generate and renew my certs for my website. Unfortunately, it does not support subdomains. Having said that, I have a ton of rewrite rules that work fine. For example: ...
7
votes
2answers
879 views

Is Checking For mod_write Really Necessary?

Recently I noticed that many people post .htaccess files here with: <IfModule mod_rewrite.c> Sometimes this even appears several times in the file! It obviously checks to see if mod_write is ...
4
votes
1answer
2k views

Redirect all index.html pages to subdirectory?

I have an old site ported from WordPress to basic HTML (don't ask why) and every page is ending in the subdirectory/index.html. This is causing some funky indexing issues, so I wanted to 301 all the ...
1
vote
1answer
58 views

Htaccess - replacing a query string with a numeric value

I don't know why but this htaccess item doesn't work for me. I have something like this after update user profile public/user_profile/show_user.html?id=4 and I want to have public/user_profile/...
0
votes
0answers
12 views

Pages viewable stacked on top of one another? [duplicate]

I've asked this before but couldn't find my old account. I'm trying to figure out why my webpages are being stacked on top of one another in my control panel. I think it's a scraper doing the return ...
2
votes
1answer
128 views

How can I rewrite all Files to the Index Folder and also Remove the Extensions

I've been looking for a solution for a few hours now, and I'm struggling to understand why the Regex doesn't act like Regex... If you just try to match a letter, it doesn't match a letter, and I can't ...
6
votes
2answers
9k views

Remove query string from 301 redirect URL

I'm having some trouble with redirects and I haven't been able to get this to work. I want to make the following http://www.example.com/seasonal/christmas?p=15 redirect to http://www.example.com/...
1
vote
1answer
100 views

Creating web hosting in a laptop

I was searching Google for how I can configure my webdoamin registered with GoDaddy and static IP I have obtained from Mumbai ISP. I have seen one question which was asked three years before in which ...
2
votes
1answer
40 views

Apache doesn't redirect subfolders

I'm having trouble configuring my Apache server through the .htaccess file. I want to redirect all request from my domain (example.com, www.example.com, example.com/folder1/folder2) to my new domain (...
1
vote
1answer
173 views

PHP Undefined index: REDIRECT_STATUS - error 404

Custom 404 page in PHP using .htaccess file. If page dosen't exist redirect to error.php. I don't know why but it doesn't work. Notice: Undefined index: REDIRECT_STATUS on line 2 <?php $error = $...
1
vote
1answer
180 views

Htaccess RewriteCond based on environment variable

I find apache very unfriendly. Anyway. I have this: RewriteRule (.*) - [QSA,E=DOMAIN_NAME:localhost.com] This doesn't redirect, which is fine: RewriteCond "www.%{ENV:DOMAIN_NAME}" "!=...

1
2 3 4 5
23