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

Apache2 keeps rewriting https even though rewrite rules are removed

I am running multiple virtual hosts on a local machine running Ubuntu 14.04 and Apache2. Let's assume that the project I am trying to access has the ServerName directive set to website.local When I try to access it in the browser with website.local…
Pankrates
  • 125
  • 1
  • 7
0
votes
1 answer

How to share a Single Domain SSL certificate across 2 ip addresses

I have a wordpress website example.com. I have a single domain SSL certificate that can be used across multiple servers. When a user visits example.com, or any subfolder expect forum , they access server1 which is running apache. When a user vists…
Mutuma
  • 111
  • 6
0
votes
2 answers

Redirect page/subfolder to new domain url without changing url in browser

I have been looking for an answer this without any luck (searched everywhere) Basically, I want to rewrite a page (subfolder) to a new domain without changing the url. I've tried with no luck: RewriteEngine On RewriteBase / RewriteCond…
testmaster
  • 1
  • 1
  • 2
0
votes
0 answers

Use mod_rewrite & mod_jk to access different workers

I want to achieve the following: There is one DMZ-proxy over which we want to access multiple application-servers, represented by mod_jk workers. The web-context needs to be the same on all application servers, since they run the same application.…
Michael Niemand
  • 169
  • 3
  • 17
0
votes
1 answer

Apache2.2 mod_rewrite map function based on POST variables

Are POST variables accessible to mod_rewrite? I am trying to determine whether or not it is possible to perform a redirect with Apache2.2 and mod_rewrite where the rewrite rule considers the POST variables associated with a request, and uses these…
e7zkw9120
  • 173
  • 3
  • 8
0
votes
1 answer

Having issues with inconsistent application of mod_rewrite rules

So I've been asked to clean up the URL's for the web app that we're currently running on apache (version 2.4.9 if so interested), but after messing around with mod re_write commands for a few hours, I think I'm running around in circles. Here's what…
canadiancreed
  • 296
  • 1
  • 11
0
votes
1 answer

How To Force Rewrite and Redirect Url

I have a url: http://domain.com/i.php?c=PT and I Rewrote it to http://domain.com/PT successfully. But When I browse http://domain.com/i.php?c=PT, it wont redirect to http://domain.com/PT. Is there anyway to both redirect and rewrite it? My…
Kevin Nguyen
  • 189
  • 1
  • 2
  • 8
0
votes
1 answer

Changing dirs into subdomains

I have an Apache 2 on Debian server and I am trying to do dynamic subdomains based on dirnames. bind is configured corretly for wildcard dns entry. For example: There is this specific dir for www for user. Let it be /home/user/sites/nameofthesite/.…
servicesgpalak
0
votes
2 answers

301 Redirect. Need help. Having a hard time

I'm trying to redirect URLs and can't get anything to work. Here is what I'm hoping to do: Old URL: www.example.com/asp.pl?_puri=astore.amazon.com%2Fthegi02-20%2Fdetail%2FB0001L0DFA%2Fassid Needs to redirect to: www.example.com Anyone know of any…
Steve
0
votes
1 answer

htaccess: get request domain for mobile redirect

We have a mobile site that is served using multiple domains. We want to redirect users who are using desktop user agents to our desktop sites while preserving the original domain the user used to access the site. There seem to be a few .htaccess…
Jimmy
0
votes
1 answer

mod_rewrite not acting as expected -- missing path info

I've just installed a fresh apache (Apache/2.4.7 - Ubuntu) and created and enabled a site with a Document Root of /var/www/html. With mod_rewrite enabled, I proceeded to create a simple .htaccess file in the that directory. I then added the…
0
votes
3 answers

Redirecting an entire site to another domain

I have a website we'll call it domain.com, that was originally written in PHP. Every single valid URL contains the letters "php" somewhere after the "domain.com/" part. I recently finished a complete rewrite of the site using Django, currently…
nbv4
  • 603
  • 3
  • 11
  • 18
0
votes
1 answer

mod_rewrite: strange infinit loop

I have a folder structure, like this: forum .htaccess [some more files] forum_english .htaccess [some more files] forum/.htaccess looks like this: RewriteEngine on RewriteCond %{HTTP_HOST} \.(com|net)$ [NC] # just rewrite if the query comes…
Thomas131
  • 3
  • 3
0
votes
1 answer

Reverse proxy Apache rewrite rule doesn't work

I've an apache reverse proxy and i try to make a rules for redirects few urls of example2 to example1 but my rewrite rules doesn't work. I've try this in the vhost of example2 : ProxyPass / https://example1.com/index2.html ProxyPassMatch…
Olaf
  • 99
  • 2
  • 3
  • 7
0
votes
1 answer

Test file existence outside DOCUMENT_ROOT

I have this .htaccess file inside DOCUMENT_ROOT where it checks for the existence of a file, maintenance.enable and serves maintenance.html if it is present: RewriteEngine On RewriteBase / # This portion checks…
FrancisV
  • 1,766
  • 3
  • 16
  • 18
1 2 3
99
100