URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
10 views

How to combine a rewrite rule containing QSA with proxypassmatch in apache?

I need to combine the following rules in one of my VirtualHost directive: # example: /dog?sort=latest&page=1 becomes index?type=dog?sort=latest&page=1 RewriteRule ^/(dog|cat|others)$ ...
0
votes
1answer
12 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 ...
1
vote
2answers
40 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
19 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
37 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
25 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
27 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 ...
-1
votes
0answers
15 views

How should I write a mod rewrite rule to map a file to a url [duplicate]

I'm in the process of migrating an established ASPX site to PHP. I'd already made the move from ASP to ASPX before my client asked me to take over the hosting. The ASP and ASPX pages are linked to ...
0
votes
0answers
23 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
54 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
15 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
22 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
69 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
64 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
43 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
46 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
18 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 ...
0
votes
0answers
16 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
20 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
13 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
39 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
22 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
55 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
31 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
44 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
61 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
37 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
16 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
35 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
34 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
22 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
29 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 ...
0
votes
1answer
43 views

MOD_REWRITE for rewriting GET requests [duplicate]

I need a .htaccess expression to use the second get variable or get the get variable by name. Currently my mod_rewrite alters the URL to remove index.php filename and alter the pageName GET variable ...
0
votes
0answers
33 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
1answer
27 views

301 permanent redirection changing URL structure [duplicate]

I changed category urls on site. Old are like this: www.example-name.com/category-name-exactly-same-keywords/ ...
-2
votes
2answers
27 views

redirection of https page in apache [duplicate]

As it currently works. The endusers have to go the URL: https://cloud.olaf.europe.eu/owno and that works but i want the users just to go to: https://cloud.olaf.europe.eu/ to access the page. I ...
0
votes
0answers
35 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
1answer
36 views

404 returned though rewrite rule is matched

I have one rewrite rule that sends all requests to index.php: RewriteRule ^.*$ index.php [NC,L] (Apart from RewriteEngine On, that's all there is in the .htaccess file) It works, unless the ...
0
votes
0answers
26 views

After migrating to Plesk 11 / Apache 2.2.15, some rewrite rules ignored [duplicate]

First, thanks in advance for any insight. We recently migrated to Plesk 11 / Apache 2.2.15. After doing so a number of our rewrite rules no longer work as expected. For example, this no longer ...
0
votes
0answers
18 views

Multiple domains one codebase [duplicate]

I'm building them a single site that has multiple languages. Originally, I was told that they wanted to site to just go to a single domain..so it would be something like this: example.com/it/home or ...
0
votes
0answers
13 views

Mod Rewrite: Add Language Prefix to Sub Directory [duplicate]

I am proxying a tumblr blog to a 3rd level deep subfolder. I am not sure if it is because of the directory path or the rewrite base, but I cannot seem to be able to remove the first blog. Instead of ...
0
votes
1answer
24 views

Rewrite rule custom 301 redirection

I have link like this: www.example.com/full-image/folder/subfolder/image-name.jpg-some-custom-keywords.html and I need 301 redirection to url like this: ...
0
votes
1answer
41 views

What can cause “Invalid command '%{HTTP_USER_AGENT}'”

While browsing my site, not even making any modifications to it, the whole thing suddenly 500's on me. Error log is full of this: Invalid command '%{HTTP_USER_AGENT}', perhaps misspelled or defined ...
0
votes
1answer
37 views

Apache Dynamic Virtual Host with SSL [duplicate]

I have the following in my httpd.conf file NameVirtualHost *:80 <IfModule mod_vhost_alias.c> <VirtualHost *:80> ServerAlias * UseCanonicalName Off LogFormat "%V %h %l %u %t ...
0
votes
1answer
78 views

Apache mod_proxy+mod_rewrite = “Request exceeded the limit …” error [duplicate]

Good day, I'm using Apache as a reverse proxy for my Tornado app which runs on http://localhost:8090. I want Apache to proxy everything that arrives to /api/v2 through HTTPS to http://localhost:8090. ...
0
votes
1answer
55 views

Apache Dynamic Virtual Host: RewriteMap: file for map vhost not found

Following the instructions on Apache's site I have added the following to the end of my httpd.conf file: RewriteEngine on RewriteMap lowercase int:tolower #define the map file RewriteMap vhost ...
0
votes
2answers
48 views

getting started with apache mod_rewrite on a virtual host [duplicate]

hey SO I am attempting to use apache's mod_rewrite module to do some basic rewrting of url on my website so they become a little more seo friendly basically I have a virtual host file that look ...
0
votes
1answer
84 views

nginx url rewrite rule

I'm doing a migration from a WordPress blog to a Jekyll Blog using NGINX as my HTTP server and I don't want to break the Internet by leaving some URL's not working as expected. I got to a point where ...
0
votes
0answers
48 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 → ...
-1
votes
1answer
33 views

Apache MOD_REWRITE for subdomain

Summary I have 2 servers, 1 Production & 1 Development Problem I want to keep the servers URLS the same in the code. The production server will be blah.com but I want the development server to ...