URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
50 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 ...
1
vote
3answers
58 views

mod_rewrite all but two files causing loop

I'm trying to set up a web site to allow the creation of a semaphore file to close the site. The logic I want to follow is: when the semaphore file exists and the request is not for /style.css or ...
0
votes
0answers
121 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
16 views

How to write an apache rewrite rule from /?param=1&param=2 to /index.php?param=1&param=2 [duplicate]

I am trying to figure that out but my regex experience is non-existent and apache rewrite rule is intimidating. Can anyone shed a light?
0
votes
0answers
57 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
1answer
47 views

VirtualHost Redirect should work with new RewriteBase

Inside the VirtualHost I got this redirect: RewriteBase / RewriteCond %{REQUEST_URI} wp-content/uploads/([^.]+\.(jpe?g|gif|bmp|png))$ RewriteRule (.*) http://example.org/$1 [R=301,L,NC] So the full ...
0
votes
0answers
33 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
1answer
68 views

Apache mod_rewrite redirecting to base URL

I'm busy migrating a production codeigniter project to a new server. The current setup has been working fine for almost a year now but while moving to the new LAMP stack I'm running into a weird ...
0
votes
2answers
91 views

Mod_Rewrite Error code: ERR_TOO_MANY_REDIRECTS

I know alot people have post about this error , however i still unable to solve it.So that is the reason why i start a new post with it. As stated in the title , i encounter a redirect loop when ...
0
votes
1answer
28 views

RewriteRule Not Rewriting URL properly [duplicate]

I have the following virtual host file: <IfModule !wsgi_module> LoadModule wsgi_module modules/mod_wsgi.so WSGISocketPrefix run/wsgi </IfModule> <VirtualHost *:80> ...
0
votes
0answers
65 views

apache reverse proxy 404 image error

I have some error with my apache reverse proxy. Currently I am doing reverse proxy to 4 websites. 1.1.1.1/a 1.1.1.2/b 1.1.1.3/c 1.1.1.4/d I am having no problem when reverse proxy to a and b ...
0
votes
0answers
99 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 ...
1
vote
1answer
173 views

Apache2 mod_rewrite Clean URL - working, but files not accessible

Server: Debian Jessie Apache: 2.4.9-1 PHP: 5.5 What I want is all non-files and non-directories to redirect to index.php where I handle them myself. Due to the nature of my project I must work from ...
0
votes
2answers
196 views

How to pass arguments through ProxyPass in Apache

What I'm trying to do and I've got stuck is: I've got apache server that will catch certain url's and for some of them, he will use ProxyPass (or mod_rewrite) to pass something as reverse proxy to ...
1
vote
2answers
58 views

Apache2 and rewritemap - hours of trying

I stuck with rewritemap problem. What I want to do is redirect thousands of old nearly random urls to new ones. I will build map manually, but I need this code to work. RewriteCond ...
0
votes
1answer
32 views

Using mod_rewrite rules in global server config

The Problem I'm attempting to make a mod_rewrite rule in Apache's global server configuration, and have it take effect for all Virtual Hosts. The documentation certainly indicates this is perfectly ...
0
votes
1answer
73 views

htaccess redirect HTTP & HTTPS non-www to HTTPS www

How can I redirect my website from all HTTP requests to HTTPS + non-www HTTPS to HTTPS with www.? Example: Redirect HTTP non-www, HTTP www. & HTTPS non-www: HTTP:// example.com/ && ...
0
votes
1answer
36 views

How to change image folders and domain with mod_rewrite?

I have images like this - http://www.site1.com/upload/long/long/long/long-path/image.jpg I need redirect all images in folder upload to another site and strip path. Example ...
0
votes
1answer
34 views

Why does this rewrite rule require *.*

I want to redirect requests for any images with filenames starting with a string like 'myimage_' to a subdirectory on another server. I'd like to understand why the following rule does not work for my ...
0
votes
1answer
35 views

Forwarding original URI within mod_rewrite

I'm trying to use mod_rewrite and somehow forward - preferably via a header - the original URI to my application server. What I'm really sticking up on is how to get the information I send to carry ...
0
votes
1answer
172 views

Dynamicly reverse proxy a subfolder to subdomain in Apache

I would like to dynamically proxy sub folders to sub domains on another host. For example, I have the following reverse proxy setup for a single sub folder to sub domain: ProxyRequests Off ...
2
votes
2answers
49 views

Redirect to SSL without malforming GET arguments

I added this to .htaccess to redirect HTTP to HTTPS: RewriteEngine On RewriteCond %{HTTP:X-Forwarded-SSL} !on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] It works, but it ...
-1
votes
1answer
42 views

Mod rewrite htaccess worked on old server, not on new server

I have the following .htaccess file, which worked fine on my old host. I moved over to an AWS instance (Ubuntu 12.04 LTS), and it's no longer completely working: <IfModule mod_rewrite.c> ...
1
vote
2answers
44 views

Trying to understand this set of Apache2 Rewrite Rules

I have the following Apache2 Rewrite rules and I am trying to decipher the meaning behind them: 1. RewriteEngine on 2. RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4 3. RewriteCond %{REQUEST_URI} ...
0
votes
0answers
162 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: ...
1
vote
1answer
48 views

Amazon Web Services: Managing Public DNS and Elastic IP Content Duplications with mod_rewrite

I'm currently addressing content duplication issues of my AWS website for SEO purposes. More specifically I am trying to implement re-write rules for the duplicate addresses: Public DNS ...
0
votes
0answers
46 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 ...
1
vote
2answers
313 views

Apache Redirect To Another Server with subdomain

I am currently running CentOS which hosts my web and gitlab server and a windows machine that is hosting a subsonic server. Currently, my ip points to the CentOS but does not redirect correctly. I am ...
1
vote
1answer
57 views

apache change proxy request url rewrite

I have problem with proxy requests. I need to enable apache mod_proxy for my subdomains but i forgot to set Allow from mydomain.com, it was Allow from all...Yes, i created open proxy for all world... ...
0
votes
1answer
45 views

Apache mod_rewrite - why friendly URL doesn't works with static files?

My configuration to use friendly URL works fine when the destination is a php script, like this: RewriteRule ^products/([a-z0-9-]+)/([0-9]+)/?$ /prod.php?id=$2&name=$1 [NC] But, when I use a ...
0
votes
4answers
95 views

Modrewrite phpmyadmin to HTTPS

I'm using this to force access to phpmyadmin onto HTTPS but it's staying on HTTP, other directives in the .htaccess file of the site work fine. RewriteEngine On RewriteCond %{SERVER_PORT} 80 ...
-1
votes
1answer
128 views

mod_rewrite: Redirect https://example.com to https://sub.example.com [duplicate]

I have an domain example.com running on an Apache Server and I want to redirect every call to https://example.com to https://sub.example.com. I have a Virtual Host configured like this: ...
-2
votes
1answer
48 views

Apache mod_rewrite with content moved to different subdomain [duplicate]

I have a url xyz.example.com for which contents were moved to abc.example.com. I know this can be redirected using mod_rewrite and had moved too, but when accessing xyz.example.com, in user's browser ...
0
votes
0answers
58 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 ...
-1
votes
1answer
31 views

apache disable unconfigured subdomains [duplicate]

There is a webserver which has example.com, www.example.com, my.example.com, shop.example.com, static.example.com. All sites except www.example.com is on https. My problem is when I type ...
1
vote
0answers
18 views

RewriteBase in httpd.conf + RewriteRule in .htaccess? [duplicate]

RewriteBase is set in httpd.conf for an alias: Alias /test /home/user/test <Directory "/home/user/test"> AllowOverride All Allow from All RewriteEngine On RewriteBase /test ...
1
vote
0answers
61 views

apache mod_rewrite rules for subdomain and restful structure

I'm trying to setup several rewrite rules that allow a restful url structure to exist, but only on a certain subdomain. Several subdomains already point to the shared codebase. I also have an ...
0
votes
0answers
18 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 ^([^/]+)/([^/]+)/? ...
1
vote
2answers
82 views

Server-level block, deny, or redirect based on User-Agent?

We've recently begun having trouble with web-scraper/DDoS service 80legs taking down our servers a couple times per week due to their abusive crawling practices. Initially we were simply dropping in ...
-1
votes
1answer
57 views

Block Wildcard User-agent

how can i write rewrite condition for wildcard user agents here is the code I'm trying but doesnt work RewriteCond %{HTTP_USER_AGENT} !*uTorrent* [NC] RewriteCond %{HTTP_USER_AGENT} ...
1
vote
2answers
81 views

Can Apache be made to not send responses to specific requests?

In an effort to harden a public-facing webserver, my colleague and I came up with a plan that involves getting Apache to "Black-hole" certain requests. For instance, requests for phpmyadmin (which ...
-1
votes
1answer
56 views

Apache htaccess get subdomain and prepend it to path [duplicate]

this is my first question on ServerFault and I think I couldn't find a similar one. To the point. I would like to achieve the following using my .htaccess. subdomaina.example.com/stats/ -> ...
2
votes
1answer
122 views

Disable Apache basic auth in virtual subdirectory

I have a webserver that is completely locked down with Basic Auth <Location /> AuthType Basic # [...] rest of basic auth stuff require valid-user order deny,allow deny from ...
1
vote
1answer
160 views

Weird apache mod_rewrite behavior

I'm new to the site and I hope you can help me with an issue that happened to me trying to install Rhodecode. Here's the (long) story: I've managed to install Rhodecode inside a virtualenv in a linux ...
0
votes
1answer
67 views

Apache2 mod_rewrite redirect all except one folder [duplicate]

I need to redirect the requests for my old website (www.old.com) to the new domain (www.new.com) but I would like to keep the old content available in a different folder (www.old.com/oldsite). I've ...
0
votes
1answer
58 views

Combine chained rewrite rule to remove all trailing slashes

I'm using this rule to remove all trailing slashes: RewriteRule ^(.*)/////////$ $1 [N] RewriteRule ^(.*)////////$ $1 [N] RewriteRule ^(.*)///////$ $1 [N] RewriteRule ^(.*)//////$ $1 [N] RewriteRule ...
0
votes
1answer
80 views

convert lighttpd to nginx rewrite rules

I'm trying hard to make my code work on nginx. This configuration works with lighttpd but I want migrate it to nginx. Rewrite rules on lighttd : url.rewrite-once = ( "^/(ui)/(.*)$" => ...
0
votes
1answer
98 views

Apache Adding DocumentRoot to URL when www not used - could be rewrite issue

When I visit www.mysite.com all is well. When I visit mysite.com (without the www) I get redirected to http://www.mysite.com/home/admin/domains/mysite.com/public_html which gives a 404 error. ...
0
votes
1answer
33 views

Apache rewrite rule adds 2 superflous slashes

I want to redirect all www to non-www with a google friendly 301 in apache2.2 It works basically but when I enter www.test.net in the browser I get redirected to test.net// and I would prefer without ...
0
votes
1answer
96 views

Apache: proxy an internal URL using regex

I have a few servlets listening on internal ports which are not accessible from outside. I use Apache's ProxyPass and ProxyPassReverse directives to serve them securely from port 443: ProxyPass ...