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
1 answer

Apache rewrite for sub-domain

I have 2 applications running on JBoss with an Apache server in-front. The applications are currently being proxied by Apache: ProxyPass /App1 http://mydomain.com:8080/App1 ProxyPassReverse /App1 http://mydomain.com:8080/App1 ProxyPass /App2…
damo
  • 103
  • 3
0
votes
2 answers

Wordpress shows permanent loop redirect after upgrading from Apache 2.2 to Apache 2.4

I've upgraded my Apache 2.2 web server to 2.4 today and then some Wordpress installations started to get infinite loops from non-www to www and from www to non-www :( Removing .htaccesss didn't helped. How to solve this ? Example domain…
Marek Zakrzewski
  • 163
  • 1
  • 2
  • 11
0
votes
6 answers

Mod_rewrite (CakePHP routing functionality) forbidden after Snow Leopard upgrade

I am using the standard Apple-provided installations of PHP 5.3 and Apache 2 to do web development on a Mac Pro that I just upgraded to Mac OS X 10.6 (Snow Leopard). The upgrade went well enough, if I ignore the fact that it destroyed my ability to…
0
votes
1 answer

Redirect all vhosts when a certain condition is true

I am trying to redirect all vhosts to a certain url based on the REQUEST_URI. For example if somebody makes a request to www.something.com/condition on my server to be redirected to google.com I included a file in my httpd-vhsots.config and inside…
user1
  • 181
  • 1
  • 1
  • 3
0
votes
1 answer

htaccess rewriting same page names conflict

My htaccess file has the following two lines RewriteRule ^payment payment.php RewriteRule ^payment-confirmed payment-confirmed.php When trying to access payment-confirmed.php it just goes to payment.php (payment) - I'm guessing this is because it…
0
votes
2 answers

"deny all" for all files in a directory

My server is getting hit hard by bots, etc., looking for various files in /cgi-bin/, like search.cgi, YaBB.pl, gitweb.perl, perl, gitweb.pl, htsearch, and on and on. I want to deny all access (send a 403 Forbidden header) for all possible file names…
markratledge
  • 519
  • 5
  • 13
  • 26
0
votes
1 answer

Allow Parent .htaccess to redirect all assets

We're migrating from one subdomain to another. This particular domain has a subset of several websites. I've setup the following rewrite to handle the redirect globally: In docroot/.htaccess ("Rule #1") RewriteEngine On RewriteCond %{HTTP_HOST}…
Nathan J.B.
  • 151
  • 1
  • 6
0
votes
1 answer

Mod_rewrite rule to force use of particular domain name for a specific directory

I'd like to force the use a different hostname/domain name for a particular directory on my site. Currently, there is a directory that contains several webpages at mainsite.com/directory. For the pages that reside in just that directory, I want the…
kma
  • 3
  • 1
0
votes
1 answer

Apache 2.4 mod_rewrite in Vhosts not working in WAMP local server, but working in .htaccess

I had some mod_rewrite rules in Apache 2.2 local dev server and they were working fine. Now After upgrading to Apache 2.4, I am trying to do a simple mod_rewrite rule and it is not working. It is however working with .htAccess. Is this a path…
Yasser
  • 5
  • 4
0
votes
0 answers

Is there a way to redirect HTTP to HTTPS using mod_proxy_ajp or this could be done only at mod_rewrite side?

What is the easiest way to redirect http to https when mod_proxy_ajp is used? I have the configuration below for mod_proxy_ajp: ProxyPass /home ajp://localhost:8080/home ProxyPassReverse /home ajp://localhost:8080/home I was hoping if there is a…
JonathanC
  • 1
  • 1
0
votes
1 answer

mod_rewrite - detect a GET Request URL and render index.php

Sorry for the 1000000 topic on this, but I've been trying and searching for hours and couldn't find anything. Basically, I have already used mod_rewrite to allow someone to type in www.example.com/web/chat/tf/ and that would go…
Luop90
  • 1
0
votes
3 answers

How do I do a case-insensitive mod_rewrite redirect to the same URL (mod case)?

I'm using a case-sensitive web application to serve a few URLs that will be printed, so we expect UsErs to type them with inexact case. How do I tell mod_rewrite to redirect to the correct case URL as in [NC] without also redirecting on the…
joeforker
  • 2,399
  • 4
  • 26
  • 35
0
votes
2 answers

simple mod_rewrite rule not working

I want to redirect users from http://uppereast.com to http://nyclocalliving.com. This is the .htaccess file I have below, but I am not getting redirected to my new URL. RewriteEngine on RewriteCond %{HTTP_HOST}…
Tim
0
votes
1 answer

Wordpress Rewrite Redirect Failure

I'm helping a friend recover from the mess outsourcing a wordpress website caused him (mistake #1) and I have this weird error. The hosting he is using appears to be redirecting www.domain.com to domain.com (NFI why) automatically which works fine…
Rory Hart
0
votes
0 answers

Truncate URL's with Apache mod_rewrite

I am trying to strip incoming page requests to 25 characters after the year/month structure of the URL on my Wordpress server. Reason is, there are a number of external 404 links that I would like to resolve. The Wordpress server is able to guess…
Kris
  • 1
  • 1