Questions tagged [mod-rewrite]

mod_rewrite is an Apache module that allows for server-side manipulation of requested URLs.

For an introduction and examples of using mod_rewrite, read over the comprehensive article,
"Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask"

2224 questions
0
votes
0 answers

Apache 2.4 - Redirect Folder to Sub-domain

I have an application running at https://webapp.ex - An external application downloads hundreds of PDFs from within the application directory (e.g. https://webapp.ex/Modules/sub/directory/study.pdf) - The 'Modules' directory has grown significantly…
Ralph
  • 862
  • 11
  • 26
0
votes
0 answers

Load subdomain from folder with htaccess

I have a project setup where I have multiple subdomains for different purposes like login.example.com, signup.example.com and blog.example.com. I only have the domain configured but not created any sub-domains. All sub-domains should be loaded from…
Vikram
  • 167
  • 2
  • 10
0
votes
1 answer

htaccess .zip url rewrite from /*.zip to /key/*.zip

Currently I have some zip files stored in the http root of my php/apache web server. Currently I can access the files using this: http://example.com/filename.zip However, I want to "protect" the access to this files, and they should only be…
dikonubiga
  • 11
  • 3
0
votes
1 answer

Trying to use Apache 2.4 ReWriteRule in a reverse proxy from / to /repo

I have a html server http://pp000c29784409.usask.ca/ that i am trying to reverse proxy from an Apache 2.4 server using ProxyPass ,ProxyPassReverse and RewriteRule. the idea is to display all the html content from…
R.Merritt
  • 127
  • 1
  • 3
0
votes
1 answer

Rewrite wildcard subdomain and wildcard domain

For a webserver where a bunch of domain names are hosted, we'd like te implement a redirect where any subdomain on any domain is redirect to its www. equivalent. sub1.domain1.com -> www.domain1.com sub2.domain5.com ->…
0
votes
0 answers

Mapping alias in virtual host for a website - URL routes do not work

I have two Laravel sites: a front page and an API site. My customer will later separate the API site on a subdomain, but for the time being the customer wants to serve the API from inside "subfolder" of the landing page (mostly because he does not…
JustAMartin
  • 231
  • 1
  • 18
0
votes
1 answer

Sessions getting lost behind Apache virtual hosts

I have a Tomcat server at port 8080 behind an Apache server at port 80. I have virtual host setup with mod_rewrite which redirects to Tomcat using the below lines in 000-default.conf: ProxyPreserveHost Off ProxyRequests Off …
0
votes
1 answer

apache2 append www to https url

I have an apache2 webserver in AWS using bitnami. In my bitnami.conf file I need to rewrite all URLs to https://www.example.com I am able to redirect the following correctly mydomain.com http://example.com www.example.com But when the url is…
0
votes
2 answers

Why doesn't this .htaccess file redirect properly?

I have a web application with multiple pages. The .htaccess file redirects everything after the domain-name.com/ to my index.php file, which processes the input and renders the appropriate page. However, I also have some actual directories under…
Ryan Griggs
  • 963
  • 2
  • 14
  • 29
0
votes
2 answers

HTTP to HTTPS redirect not working on Apache 2.4

I have this apache config: DocumentRoot "/home/example/public_html/" ServerName www.example.com allow from all RewriteEngine on RewriteRule ^(.*)$ https://www.example.com/$1…
Noodles
  • 1,386
  • 3
  • 18
  • 29
0
votes
1 answer

URL without "https://" does not work in Apache

I am using Apache as a proxy server for my web application wich is running in a Glassfish container. I configured the proxy pass and also SSL in Apache. The site can be accessed from outside with the URL https://www.my-domain.com without any…
Lakshi
  • 101
  • 2
0
votes
1 answer

converting htaccess url rewriting rules into nginx

How can i convert my htaccess rules here RewriteRule ^/?([^/]+)/([^/]+)/?$ page-1.php?a=$1&b=$2 [L,QSA] RewriteRule ^/?([^/]+)/([^/]+)/([^/]+)/?$ page-2.php?a=$1&b=$2&c=$3 [L,QSA] into nginx rules? I've tried using converters but i got the…
Axon
  • 3
  • 2
0
votes
1 answer

How to direct all URLs to https www version only

In my httaccess file on Drupal I want every URL possibility to end up redirecting to https www site org (Note the 's' and 'www') I can get the following working: www.site to auto redirect to https www.site http www.site to redirect to https…
SSS
  • 1
0
votes
0 answers

Redirecting site to HTTPS and www using htaccess

I have used this code in my .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^silkgifts.co.uk RewriteRule (.*) https://www.silkgifts.co.uk/$1 [R=301,L] it directs my HTTPS non-www to the HTTPS www site also it directs the HTTP non-www to…
sue
  • 1
0
votes
0 answers

Yet another mod_rewrite - how to achieve desired result

I would really appreciate some help with a mod_rewrite, I know there is 64K answers on Stack Exchange about this topic and my answer is probably in there somewhere if only I could find the ones to put together to do this These rules need to be fully…