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

Configuring Fancy URLs in Apache2 for Statusnet on Ubuntu [Resolved]

I'm trying to evaluate statusnet (formally laconica) for deployment as our internal microblogging system but have run into a bit of a wall. I have the latest version (0.8.2) installed and running, i.e. I can register as a user, post messages etc. So…
DilbertDave
  • 352
  • 1
  • 4
  • 11
0
votes
5 answers

Configuring Apache, Tomcat, mod_jk and mod_rewrite to serve up tomcat from top-level

I'm trying to set up my java app as the main component of a new site. I have some static resources I'd like served by Apache, so I setup Apache and Mod_jk, with the following rules, JkMount /java_app* ajp13 JkUnmount /*static/* ajp13 …
lucas
  • 101
  • 1
  • 5
0
votes
1 answer

How do I tell the client the new filename with mod_rewrite?

I'm trying to convert requests like /download.php?name=one into /downloads/one.zip instead. The following sends the correct file, but the client saves it as download.zip instead of one.zip RewriteEngine On RewriteCond %{REQUEST_URI}…
Pascal
  • 493
  • 3
  • 11
0
votes
1 answer

Apache redirect Absolue url to relative url

So I want to load a web-app from a subfolder. Current configuration looks like this ServerName YOUR IP ADDRESS/DOMAIN ServerAdmin webmaster@localhost DocumentRoot /var/www/html/
0
votes
1 answer

Using mod_rewrite to redirect single pages

The first requirement was to redirect traffic from http://www.old-domain.org to https://example.press -- but only do so for the root of the domain; any specific page should be available on the old domain. So I did a little studying, and this did…
alexakarpov
  • 103
  • 5
0
votes
1 answer

How to generate canonical URLs with apache/mod_rewrite on passenger?

We had once a working setup per .htaccess to redirect a visitor to a canonical URL (for SEO reasons, reduce double content) if she or he visited our rails app: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] RewriteRule ^(.*)…
hurikhan77
  • 477
  • 3
  • 9
  • 23
0
votes
2 answers

apache2 reverse proxy, rewrite issue

I keep telling myself this should be simple. Background: I had a site set up (https://example.com) using Let's Encrypt for the SSL setup. Works great. I added a new server to the internal network with another site, NO SSL setup at all. Works great.…
0
votes
1 answer

apache2 reverse proxy configuration

I have one application that listens on TCP 127.0.0.1:81. I want to accomplish the following redirection: www.example.com/?requestid=123456 --> http://127.0.0.1:81/?requestid=123456 www.example.com/ANYTHING_ELSE --> MY_IP_THAT_APACHE_LISTENS_ON My…
creed
  • 1
  • 1
0
votes
2 answers

Apache mod_rewrite redirects me to https://www.(literally) for some reason

I configured an Apache server on my Ubuntu 18.04 computer with HTTPS support. I have a SSL Certificate for *.example.com so my solution for have HTTPS on example.com was to redirect it to www and then redirect to HTTPS for all the subdomains. Here…
mathmaniac88
  • 111
  • 1
  • 1
  • 8
0
votes
1 answer

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 case, just redirecting http to https. Here is the…
Kevin Buchs
  • 353
  • 1
  • 3
  • 20
0
votes
1 answer

port RewriteRule from apache to nginx

we have a large php application running on apache now which I would like to migrate to nginx. I’ve got everything to work correctly except for a RewriteRule in a .htaccess file. The web app allows the user to store files which can be publicly…
0
votes
0 answers

Apache rewrite rule not working for blocking spamdexing referrer http://site.ru

I have the following rewrite rule in my .htaccess file. RewriteEngine On # START Upgrade unsecured connections RewriteCond %{HTTP_HOST} my-site-com-dot-com\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$…
AngelP
  • 1
  • 2
0
votes
1 answer

mod_rewrite -- .htaccess redirect to new url with /path and query string intact

Looking for help in writing an .htaccess file to redirect to a new address with the url/query string intact -- User url input: http://www.example.com/path?query-string=something    -or- http://example.com/path?query-string=something    will be…
Mike B
  • 9
  • 1
0
votes
1 answer

Apache2 Cannot make work simple mod_rewrite rule

I would like to configure my apache2.4.7 to redirect requests internally like this: /app/download/somefile => /app/download.php/somefile or sth comparable. After various attempts which all don't work I've come down to a very simple replacement…
kaidentity
  • 193
  • 1
  • 1
  • 5
0
votes
2 answers

Apache reverse-proxy intermittent error 113 - No route to host

I've got an Apache 2.0.52 server on CentOS 4 that front-ends a couple of App servers (mix of Jetty and Tomcat). Apache has a handful of virtual hosts configured like this: ServerName www1.example.com …
BonkaBonka
  • 123
  • 1
  • 1
  • 5