Skip to main content

All Questions

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

.htaccess to accept parameters in URL

I have a WordPress page with the following structure website.com.au/pre-registration/parameter-value/, where the parameter value was originally a GET parameter, but I was requested to make it part of ...
Leonardo Pessatti's user avatar
1 vote
1 answer
80 views

Apache VHost Redirect /dir/ to subdomain

I had applications running on the following variable links: www.example.com/topics/vardir/show www.example.com/education/topics/vardir/vardir/show www.example.com/literacy/topics/vardir/show www....
Josh Hawkes's user avatar
1 vote
3 answers
213 views

apache2 rewrite is working, but doesn´t keep URL

I was looking around google for some days now and can´t get it to work. With apache rewrite: domain.com > test.com/test (but keep the URL domain.com in browser) The whole SSL Config: <...
roku's user avatar
  • 11
0 votes
0 answers
390 views

Apache URL rewrite to hide port numbers of web servers

I have an Ubuntu server running Gitea and Jenkins on ports 3000 and 4000 respectively. I want to be able to access them through a user friendly url like http://myhost/gitea and http://myhost/jenkins. ...
shane.singwa's user avatar
0 votes
0 answers
162 views

apache2 reverse proxy, how to serve multiple domains with backend recognizing only 1 valid uri

I have an Apache reverse proxy set up and my backend service is configured on a specific static ServiceUri="site.com". I would like requests coming for multiple domains a.site.com/data, b....
Mnemosyne's user avatar
  • 131
3 votes
2 answers
1k views

SEO friendly URL not working

I have a folder structure like the below www.exampe.com/distributor/index.php and I want to access the file via an SEO friendly www.example.com/distributer/abcinc and then in the index.php want to ...
Jayreis's user avatar
  • 145
1 vote
0 answers
60 views

rewirterule in apache conversion to nginx equivalent rewrite rule

Apache server rewrite rule has been written below: RewriteEngine on RewriteRule "^/cesop(.*)$" "http://LSVCHN-EPAP01/cesop$1" [P] In Internet browser, type below: https://...
Radhakrishnan Meiyappan's user avatar
1 vote
1 answer
81 views

How to load requested file from sub-directory without rewriting base

Utilizing .htaccess rules, I'm attempting to load a file from within a sub-directory while keeping the frontend URL unchanged if both the domain and file path match criteria. Example of URL: example....
sparecycle's user avatar
4 votes
1 answer
2k views

htaccess rewrite /dir/*.jpg to /dir/webp/*.webp only when webp file exists

I'm trying to rewrite all website files (*.jpg|*.gif|*.png) to *.webp in a subdir, but only when the *.webp file exists. Previous and new files have the same name, only changing the extension and *....
Diego Flores's user avatar
1 vote
1 answer
92 views

2 websites hosted on same domain, 1 needs to look like a subfolder ( /blog)

I bought a VPS for my new project running apache. On it I have 2 websites on the same domain. The first one is Ruby on Rails /var/www/html The second one is Wordpress /var/www/blog I want Wordpress to ...
Adelle's user avatar
  • 13
0 votes
1 answer
142 views

How to redirect domain to path in apache server using debian 10 OS

I am currently using "xyzservice.abcindia.local" as a website using a reverse proxy, Now what I want to achieve is, when I hit the "xyzservice.abcindia.local" this should redirect ...
Akshay Bhandakkar's user avatar
0 votes
1 answer
888 views

Apache redirect URL to another virtualhost

I have two sites which runs independently on my VPS, let's call them site1 and site2. They are respectively located at /var/www/html/site1 and /var/www/html/site2 I don't have a domain name yet but I ...
Arkaik's user avatar
  • 113
1 vote
1 answer
342 views

Space in value part of RewriteMap

This question is related to Apache RewriteMap with URLs containing space doesn't work, but in this case the issue is a space in the value part of the map, not the key part. Say I have this entry: /...
dorian's user avatar
  • 437
1 vote
2 answers
4k views

Is it possible to redirect a subdirectory to another server while keeping the domain name

We have a working website under the domain x.domain.tld. We want to add a wordpress to it in such way we have x.domain.tld/blog but install it on another server so we don't touch anything on this old (...
Kévin Bruneau's user avatar
0 votes
0 answers
14 views

Redirect Url on Apache Server

i have this url: https://pouv.com/presentation/vues/restreint/gestionnaire/**** i want to redirect to: https://pouv.com/bo/ I do this on my .conf: ## Rewrite rules RewriteEngine On RewriteRule ...
Mercer's user avatar
  • 113
1 vote
0 answers
38 views

Combine rewriting and redirection rules in Apache

I have VirtualHost configurations in Apache which used to use the RewriteEngine to do some URL corrections and finally pass control to one (or more, using mod_proxy_balancer) Zope/Plone instances. Now,...
Tobias's user avatar
  • 165
0 votes
1 answer
183 views

Redirecting https to http

I am using apache2 and I need to redirect https traffic to http for my captive portal application. For ex https://www.google.com to http://www.google.com. I place the captive portal as the gw. Can you ...
user19215's user avatar
  • 109
1 vote
1 answer
360 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/...
Buffy's user avatar
  • 11
3 votes
2 answers
2k views

How to pass secret in rewriterule to AJP protocol

I have a Apache server running 2.4.6, Tomcat 8.5.33 running lucee. We have rewrite rules that proxy to AJP on port 8009. ProxyPassReverse / ajp://localhost:8009/ timeout=3600 RewriteEngine On # ...
Grant Griffith's user avatar
2 votes
1 answer
477 views

How to "convert" htaccess rules into nginx rule?

I would like to "convert" this rules into an nginx rule. I think the location block is the right place, but my solutions doesn't work. Options -Indexes RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/...
sareew's user avatar
  • 23
0 votes
2 answers
991 views

Apache rewrite breaks when https site's url sub-directory is explicitly specified over http

I have been struggling with a silly issue, and I am sure someone has already asked this but I could not locate the correct response here or elsewhere. So here I go. I've set my .htaccess file to ...
Avi's user avatar
  • 1
2 votes
1 answer
2k views

What .htaccess RewriteRule do I need to redirect correctly when no page is specified in the URL?

In my directory http://tanguay.info/webtech I have the following .htaccess file: RewriteEngine On RewriteRule ^$ http://127.0.0.1:49900/home [P,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...
Edward Tanguay's user avatar
0 votes
0 answers
1k views

Rewrite URL after Symfony rewrites rules

The goal is to add the locale "en" at the beginning of the URLs which doesn't have it. Example https://example.com/document/file.php Becomes https://example.com/en/document/file.php The ...
DeepBlueMussel's user avatar
12 votes
1 answer
63k views

What is the difference between HTTP_HOST and HTTPS_HOST in apache .htaccess files?

I'm editing an .htaccess file.. In RewriteCondition for RewriteRules, HTTPS_HOST seems to only match urls that are accessed via https:// protocol (ssl). I saw in docs somewhere that it's a T/F ...
SherylHohman's user avatar
3 votes
1 answer
5k views

RewriteCond: check is %{HTTP_REFERER} include or equals %{REQUEST_URI}

Is there a way to check using RewriteCond whether the Referer includes the requested URI or... RewriteCond %{HTTP_REFERER} == 'host.com/' + %{REQUEST_URI} ... ? I need to catch whether the surfer ...
slava's user avatar
  • 161
2 votes
3 answers
478 views

What's a good way to hide "wordpress" from a WordPress URL?

I have an Apache2 web site with several different resources all installed directly under the DocumentRoot: http://example.com/mycodeigniterapp http://example.com/wordpress http://example.com/...
paulsm4's user avatar
  • 270
0 votes
1 answer
2k views

Apache redirect Absolue url to relative url

So I want to load a web-app from a subfolder. Current configuration looks like this <VirtualHost *:80> ServerName YOUR IP ADDRESS/DOMAIN ServerAdmin webmaster@localhost ...
CrumpledMemories's user avatar
1 vote
1 answer
445 views

.htaccess 301 redirect remove [] from the URL

I want to remove '[' and ']' from the URLs and redirect to correct link. Here is a sample URL: /forums/garage-150/cool-cars-sightings-[archived]-7610/index127.html Needs to be redirected to: /...
duterte's user avatar
  • 13
1 vote
1 answer
801 views

Rewrite then Basic Auth with Apache for Cloudfront

I have a website where all pages go through AWS Cloudfront (right now with a TTL of 0). The site domain is www.example.com, which is a CNAME to the cloudfront distribution. Cloudfront then requests ...
jdog's user avatar
  • 131
0 votes
1 answer
2k views

Apache Httpd 2.4 Rewrite Rule to return 301 redirect, but returns 302

I have two different examples of where Apache Httpd 2.4 on Centos7 is configured to perform redirects with the R=301 flag, but they are actually returning 302 redirects. One is an extremely simple ...
Kevin Buchs's user avatar
2 votes
2 answers
4k views

Apache reverse proxy based on header

So I have a configuration for apache that is working in 99% of the cases. It is checking a header value in the request and based on that it is redirecting to the correct API version url with a 307 ...
munHunger's user avatar
  • 383
3 votes
2 answers
5k views

Apache ProxyPass to Tomcat - how to remove context path from URL?

I have Apache conf: <IfModule mod_ssl.c> <VirtualHost *:443> ServerName project.example.com ServerAlias ci ProxyRequests Off <Proxy *> Order deny,allow ...
Justas's user avatar
  • 221
2 votes
1 answer
3k views

Use of '\' Before DOT in Domain Names in .htaccess Code

Many websites provide the .htaccess code to block spambots, spam referral, etc. Some websites use '\' before the '.' in domain names. For example: RewriteCond %{HTTP_REFERER} spamdomain\.com [NC,OR] ...
user avatar
0 votes
1 answer
55 views

Apache php app with rewrites, to serve independent files on /mydir

I've installed a php application (dokuwiki) on the / path of my apache server, but I wish to serve some different files (different files than those from dokuwiki I mean) on certain /mydir path. ...
Javier Novoa C.'s user avatar
1 vote
1 answer
1k views

Apache traffic redirection with proxypass error

Please I need some help with Apache 2.4.18. This is the third day fighting with this problem. Architecture www.myserver.com: front server for traffic redirection internal server with local ip 192....
nerdcoder's user avatar
  • 113
2 votes
1 answer
625 views

Server throws LimitInternalRecursion error when using htacess

I'm quite new to .htaccess and I just didn't get into it enough to understand what's going on. The server just says, limit of 10 internal redirects exceeded even though I can't see any reason for it ...
user407022's user avatar
6 votes
1 answer
7k views

Apache's mod_rewrite and PHP's REQUEST_URI variable

I have an issue with Apache passing to the PHP $_SERVER['REQUEST_URI'] variable the URL after it has been rewritten rather than the original one requested. I am doing this rewriting because I had a ...
Mg512's user avatar
  • 61
0 votes
1 answer
60 views

Apache with tomcat and webapps

I am completely new to configuring tomcat. I'm trying to setup apache in front and just have tomcat act as a servlet. So far everything is working fairly well and I got it all setup, but the only ...
Matt's user avatar
  • 175
3 votes
1 answer
300 views

VirtualHost/.htaccess - redirect from .com to .se/en not working/ignored (Polylang?)

I'm trying to redirect domain.com to domain.se/en, but it just won't work. It's like another rewrite or redirect is happening to domain.se/sv before I get the chance. I've tried multiple VirtualHosts ...
Jesper Johansson's user avatar
3 votes
1 answer
10k views

Drop trailing slash in apache for directory

I have the following url www.example.com/advice/ now notice the trailing slash at the end of the url? I would like that to be removed to be something like www.example.com/advice. Now when I enter that ...
Steve's user avatar
  • 135
1 vote
2 answers
2k views

Apache Rewrite Rule on Dispatcher

How can I do a rewrite rule for both http://example.com/abc to rewrite/redirect to http://example.com/abc.html but it should work when I have the URL as http://example.com/abc/def.html. Currently when ...
Sreekanth Sagar's user avatar