URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

4
votes
1answer
2k views

Apache sends plain-text response when accessing SSL-enabled site without HTTPS

I've never encountered something such as this before. I was attempting to simply redirect the page to the HTTPS version if it determined that HTTPS was off, but instead it's displaying an HTML page ...
3
votes
1answer
40 views

Apache Reverse Proxy Unescapes URL

I am running Apache 2.2.15 as a reverse proxy in my DMZ. I have an application on the internal network that I make available on the Internet for staff to use by going through the reverse proxy. As ...
3
votes
1answer
60 views

Secure Apache when using mod_proxy_http and mod_rewrite

We have an Apache server that works as a proxy for apps running on different ports. For example: domain.com/app1/service1 > localhost:101 domain.com/app1/service2 > localhost:102 ...
3
votes
1answer
250 views

htaccess rewriting all subdomains to subdirectories

I'm trying to build a catch-all for any subdomains (not captured by previous rewrite rules) for a certain domain, and serve a website from a subdirectory that resides in the same folder as the ...
2
votes
1answer
677 views

Obscuring tomcat context path in URL

I've setup an Apache reverse proxy to Tomcat that is working, in that I can load my url and get connection to the Tomcat backend. What I'm attempting to do now is rewrite the URL that a user sees in ...
2
votes
1answer
427 views

Apache mod_rewrite subdomain and URL arguments

I am trying to write an Apache mod_rewrite that can take in information from the subdomain, and after the domain and pass it as a couple of variables to a PHP script. Here is what I have so far, with ...
2
votes
1answer
153 views

mod_rewrite to page with HTTP auth

I'm trying to use modrewrite to proxy http://myserver/cam1 to an internal, http-auth protected server at http://admin:admin@192.168.99.130/cgi/mjpg/mjpg.cgi No matter what I try, though, requests to ...
2
votes
1answer
771 views

Apache redirecting https://host:port/folder to http://host:port/folder/

I have a apache server using two SSL domains (no SNI support) in different ports, kinda like this: https://host1.tld:443 (default) https://host2.tld:444 (non-standard) I have a Rewrite rule to ...
2
votes
1answer
376 views

Mod Rewrite problem with query strings

My mod rewrite rule mysteriously cuts off the periods from my query string. For example, this is the request url: http://mysite/tag/2/Search+For+Articles... this is the query string I want: ...
2
votes
1answer
543 views

Using mod_rewrite got some File does not exist messages in Apache logs

My mod_rewrite rules are working fine but sometimes similar errors showing up in my error logs: File does not exist: /var/www/examplesite/exampleurl Of course the requested directory doesn't exists, ...
2
votes
1answer
1k views

Apache mod_rewrite - remove extension/add trailing slash/preserve directory structure

I am currently using the following .htaccess file to remove the .php extension from my files and add a trailing slash to all URLs: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond ...
0
votes
0answers
114 views

302 redirect on all pages of website, creating crawler issues

My website is having difficulties working with Facebook/LinkedIn/social crawlers. I think this may be due to the redirect headers it seems to be returning. Browsers can access the site completely ...
0
votes
0answers
7 views

mod_rewrite: Use Substitution from Previous Condition

I'm trying to do a basic language redirect based on a cookie. To do that and prevent a loop, I need to check that the user isn't already on the correct URL, so I wrote this rule: RewriteCond ...
0
votes
0answers
64 views

Custome page when Apache Server is down

I've looked at Apache ErrorDocument directive on how to do this. I found an answer here and it mentioned : You should use a URL to point to your ErrorDocument otherwise if you use a filesystem ...
0
votes
0answers
117 views

Apache Alias on multiple vhosts + redirect rules

I'm facing a tricky problem and I have problems to solve it through Apache config. I have two vHosts on my machine: A) /var/www/front/web app.domain.ext B) /var/www/api/web api.domain.ext This ...
0
votes
0answers
56 views

Can you do a masked URL rewrite to a different protocol (in Apache)

Apache 2.2.15; I want to do: RewriteCond %{HTTP_HOST} site1.com RewriteRule (.*) https://site2.com [R=301,P,L] But that does not work. I put the P in there thinking it might allow the mod_proxy ...
0
votes
0answers
84 views

Proxy to SSL site (on another server) from a non SSL site

I have a *:80 virtual host in Apache 2.2.15 which is just a bunch of URL rewrites like: ServerAlias foo.bar biz.baz tit.tat RewriteRule / http://somesite.com (R=301,L) ServerAlias ...
0
votes
0answers
43 views

Remove Port Access Using mod_rewrite or Something Else

Server Info: Apache VPS, WHM/cPanel, CentOS I am using a CDN/reverse proxy (Cloudflare) to obscure the true IP of my server. So I intend to access WHM/cPanel using the direct IP like this: ...
0
votes
0answers
29 views

Handling spaces in SCRIPT_FILENAME with mod_rewrite

I'm having trouble using a reverse proxy when my URL has a space in the script name. For example: http://test.com/exam/good%20job.html?success=1 Gets rewritten and sent to: ...
0
votes
0answers
94 views

Rewrite/configure WebSVN location with MultiViews

I have configured mod_dav_svn 1.8.9 on FreeBSD along with WebSVN 2.3.3 this way: <Location /repos/svn> DAV svn SVNParentPath /usr/local/svn/repos SVNListParentPath On ...
0
votes
0answers
175 views

DirectoryIndex not working properly for rewritten URL

I have domain.com and sub.domain.com pointing to the same server and I'm using mod_rewrite to rewrite URLs for sub.domain.com to the sub subdirectory. I have the following .htaccess file in the ...
0
votes
0answers
12 views

How to get log of the addres that mod_rewrite is redirecting to?

I have defined a rewrite rule that is creating an 404. But I can't find any additional information about where the Apache is really looking for the file so it can't find it and also I don't see ...
0
votes
0answers
170 views

Apache rewriting sub domain URL with www prefix

My website is rewriting all subdomain links with www. for example news.example.com works fine, but if I go to news.example.com/wp-admin it will rewrite the URL to www.example.com/wp-admin ...
0
votes
0answers
33 views

htaccess negation rule not being followed

I'm working on a wordpress blog. The .htaccess file for it includes this block: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond ...
0
votes
0answers
27 views

ProxyPassReverse from unique path and HTTP_HOST

This is probably super simple and something I overlooked (or totally misunderstand). Trying to redirect all incoming traffic for a certain path to one of my other servers (I put the wrong environment ...
0
votes
0answers
89 views

Changing the current URL but serving content from another (same domain) - ProxyPass?

I've been banging my head against the wall with this for months now so I hope someone on here will be able to finally advise what is needed for this. I have some URL's like this:- ...
0
votes
0answers
90 views

Rewrite rule Mod_Proxy truncate file name

I search online for the solution, but nothing :(. I write this simple rule RewriteRule ^(.*)$ http://www.mysite.com/$1 [P,NE,QSA,L] In mysite.it i have an .htaccess with this rule and it's ok, but ...
0
votes
0answers
897 views

Reverse proxy 502 bad gateway

I have setup a subdomain to proxy my plesk panel, but when saving pages I am getting 502 Bad Gateway error instead of a completion message. I am running CentOS 6. Here is my vhost.conf configuration ...
0
votes
0answers
176 views

apache2 on cloud 9 : could not read /etc/apache2/envvars

I'm trying to get a Laravel app up in the new cloud9 beta, and hopefully the last step I need is to get mod rewrite working. I looked up how to do it and so I've been trying: sudo a2enmod rewrite ...
0
votes
0answers
71 views

WAMP, Vhosts and mod_rewrite not all playing nicely together

I have a client using a Windows 2012 server with WAMP installed. We use PHP 5.4 with mod_rewrite for SEO friendly URLs. All was working well with them until we tried to enable vhosts to set up a ...
0
votes
0answers
207 views

CakePHP Rewrite Loop using Subdomain Wildcards

I am using CakePHP 2.4 and usually setup a single virtualhost file to point to dev.myapp.com and everything works fine. dev.myapp.com goes to the home page, and dev.myapp.com/users goes to the main ...
0
votes
0answers
334 views

URL Obfuscation: How to securely hide backend urls with nginx or apache?

Simply put: How can I obfuscate a url? Much like whats in this post but I need to have security also in mind. Lets say I have a url endpoint: ...
0
votes
0answers
131 views

.htpasswd allow one URL with RewriteEngine = on

I'm trying to get exception from auth (.htpasswd ) for one specific URL, but seems, that it does not work with my Rewriting rules. Disabling RewriteEngine solving auth problem. My .htaccess: SetEnv ...
0
votes
0answers
74 views

I got “Request exceeded the limit of 10 internal redirects”?

I have a rewrite RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^(.*).club.domain.net$ RewriteRule ^(.*) %{HTTP_HOST}$1 [C] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
0
votes
0answers
20 views

How should I configure my mod_rewrite rule for use in subdirectory?

I have a simple PHP site that uses the following .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)/? ...
0
votes
0answers
128 views

WORKING URL with capital letters to lowercase rule for mod_rewrite

I tried both (mod_rewrite) rules from http://www.askapache.com/htaccess/rewrite-uppercase-lowercase.html But they ain't working. http://www.example.com/de/Accessoire -> 404, it doesn't rewrite to ...
0
votes
0answers
120 views

Mod-Rewrite - going from plain url to one with special characters

I am having a little issue with FreeBSD 10 RELEASE and Mod_Rewrite when it comes to special characters -- not in the source URL, but in the destination URL. The vast majority of Mod_Rewrites that I ...
0
votes
0answers
89 views

Dynamic vhosts www alias — symlink vs mod_rewrite

MI have hundreds of domains, each of them added dynamically. Now I want each domain to have www.* alias, as far as I know there are two ways to achieve this: 1) Using symlinks www.domain.com → ...
0
votes
0answers
165 views

Apache error log not showing full path of 404 failures

If I have a working path like /gallery/landscapes and I try to access this inexistent url: /gallery/landscapes/whatever I see the 404 error in my browser but the apache log says that I had an ...
0
votes
0answers
243 views

redirection in Apache include current ServerPort

For long time I am using Apache instalation which doing automated redirect with mod_rewrite (mainly root redirected to specific app and from HTTP to HTTPS but also other). There are could be severeal ...
0
votes
0answers
68 views

Making changes in Loglevel httpd.conf of apache server?

I am working on windows-7 Visual studio 2008,According to Apache: Configure "LogLevel debug" for certain modules only? i am making changes in the loglevel of configuration file I am giving ...
0
votes
0answers
71 views

Third level domain and redirect

I have a domain like mydomain.com I have bought blog.mydomain.com I want that when people hit blog.mydomain.com, they get redirected to mydomain.com/blog. What I am trying is the following ...
0
votes
0answers
522 views

Rewrite URL and keep POST data

We recently setup SVN for our web development. We'd like to be able to browse different branches/tags/trunk based on the URL you input on our dev server. So, for example, ...
0
votes
0answers
73 views

How do you exlcude a sub-directory from an Apache rewrite ruleset?

I have a multilingual site with the root being English and a sub-directory (/es/) being a human translation into Spanish. Instead of manually updating all URLs, I have a opted to use mod_rewrite to ...
0
votes
0answers
173 views

Is there a way to get a password from HTTP authorization header in mod_rewrite (apache2)

I'd like to parse HTTP authorization header in mod_rewrite - to be able to use login and password for another redirect. I want to achieve something like this: user puts ...
0
votes
0answers
23 views

mod_rewrite config works for any language except Chinese

Currently, I have this configuration in mod_rewrite in apache: RewriteCond %{REQUEST_URI} !-f RewriteCond %{REQUEST_URI} !-d RewriteRule ^([a-zA-Z]{2,3})/?$ /index.html?wtsLang=$1 [L] RewriteRule ...
0
votes
0answers
129 views

problems mod_rewrite for a root document

I thought I had a minimum of understanding about how mod_rewrite works but, it's like sendmail, I'm always a step beyond (or even further!) :-( I have summarized what I want to do in the following ...
0
votes
0answers
240 views

mod_rewrite in .htaccess w/ wildcard virtual hosts - preserving subdomain while funneling requests through index.php

I have a project which utilizes wildcard subdomains to allow requests for www.foo.com, api.foo.com, & admin.foo.com to utilize the same document root. Routing for this project is based initially ...
0
votes
0answers
269 views

How to redirect public URL request to private internal URL?

I've got a staging environment in my local network, all websites or apps are accessed by prefixing the final domain, this happens because we've got a DNS resolver running locally. For example, ...
-1
votes
0answers
15 views

rewrite rule in directory tag in httpd.conf not working

my server info: Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 Server at localhost Port 80 httpd.conf: <Directory "C:xampp/htdocs/laravel_project"> <IfModule mod_rewrite.c> ...