URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
60 views

mod_rewrite path info postfix and per-dir prefix

There's an issue with .htaccess configuration. I just need the url /category to match the category.php script, but when I try to open this url, there's a 404 error instead. Here's my .htaccess: ...
1
vote
1answer
40 views

Apache2 Reverse Proxy - different handling or urls

I struggling with a reverse proxy configuration and specific rewriting/proxypass depending on URL-path. Szenario: Reverse Proxy in DMZ SSL ends on Reverse Proxy Requests should be passed to ...
0
votes
1answer
42 views

Naked domain not working on VirtualHost for EC2

I am using AWS EC2 and I am redirecting example.com domain to a directory in EC2 with the following virtual host: NameVirtualHost *:80 <VirtualHost *:80> ServerName www.example.com ServerAlias ...
0
votes
0answers
17 views

How to allow connections from a Squid proxy AND another IP-range using mod_rewrite?

I have two virtualhosts on Apache. I will name one admin.example.com. I will name the other virtualhost blog.example.com. In my local network, there are some users under a Squid proxy. I want to ...
0
votes
0answers
51 views

What am I doing wrong in this code?

I want to redirect any request, adding a ".php" at the end of the request URI. But, if the URI has a slash ("/") at the end, I want to remove it and add .php at the end of the URI. The code below ...
0
votes
0answers
17 views

mod_jk mount is being bypassed by virtualhost rewrite rule

I have apache 2.4 and tomcat 5 configured with mod_jk. My webapp "dealernet" could be accessed without the port 8080 suffix directly at http://prefixa.mydomain.com/dealernet/login/login.do and life ...
0
votes
0answers
7 views

htaccess rewrite rule for subdomain results to redirect loop [duplicate]

Below is my htaccess config: RewriteEngine On # if the domain starts with "apply." # i.e. apply.example.com # redirect to application URI RewriteCond %{HTTP_HOST} ^apply\. [NC] RewriteRule ...
-3
votes
1answer
51 views

Redirect non www to www not working [duplicate]

I have created an .htaccess file with the following code in order to achieve this Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^example.lk[nc] RewriteRule ^(.*)$ ...
0
votes
0answers
64 views

Apache 2.2.2 (Debian) mod_rewrite with mod_proxy removes the query string

I try to setup a reverse proxy configuration based on query string rewriting with Apache2, mod_rewrite, mod_proxy (and also mod_auth_cas, but I don't think it deals with my problem). The request flow ...
0
votes
1answer
190 views

How do I remove index.php from url in CodeIgniter 2.2 [duplicate]

I have tried all the methods I can find on the web but nothing seems to work. I still get a 404 page. I already modified $config['index_page'] = ''; and add the lines to .htaccess as suggested by the ...
1
vote
0answers
12 views

Can mod_rewrite [P]roxy to an HTTPS url when the inbound request URL is HTTP?

I have a host (IIS6, running an implementation of mod_rewrite for windows, by a co called Micronovae. It works well) that has a site at http://some.host.com I also have another host (on Microsoft ...
0
votes
2answers
82 views

Apache mod_rewrite : RewriteRule to pass requests tomcat application [duplicate]

I am having difficulty defining a correct RewriteRule to forward requests to an application running in tomcat. I have apache with mod_rewrite enabled as well as tomcat setup with an application ...
1
vote
0answers
14 views

Apache Rewrite of HTTPS on another specific port with hidden subdirectory [duplicate]

I have a Tomcat behind an Apache server and I would like to use the https request to be rewritten to the Tomcat on port 9001 with a hidden subfolder /test. hosts entry: 127.0.0.1 local.domain.com ...
1
vote
1answer
15 views

URL rewriting a specific directory

I want to rewrite the URL when receiving a request that is not a file and either for directory subdir or not a directory at all. E.g. (!file) && ( (subdir ) | ( !directory ) ) Here's my ...
2
votes
1answer
70 views

apache mod_rewrite variable hostnames with one redirect?

I have a test server (webtest.example.com) and a live server (www.example.com). I also have example.org, example.net, etc. I want those to redirect to example.com. I also want any non-www entries to ...
-1
votes
1answer
21 views

Domain keeps getting rewritten without mod_rewrite enabled

So essentially when I go to http://www.example.com OR http://example.com the URL gets rewritten to just www.example.com OR example.com dropping/removing the http:// part. I'm not sure why this is ...
0
votes
1answer
89 views

mod_rewrite in .htaccess and basic auth in vhost - access to paths

I want to lock down a website (made on Drupal) with basic auth. Drupal is using mod_rewrite in its .htaccess file. The problem I'm facing is this - my virtual host looks like this: <VirtualHost ...
1
vote
0answers
10 views

.htaccess redirect keeping url when there is wordpress code involved [duplicate]

I have two domains, alfa.com and beta.com. Beta.com points to alfa.com subdirectory named "ae" by following htaccess-file. It works fine, but what should I add to code to keep beta.com URL and not ...
-1
votes
1answer
43 views

How to set up htaccess to transfer from http to https? [duplicate]

This is my .htaccess - site does redirect to HTTPS but still gives: Your connection to the site is encrypted, but Google Chrome has detected mixed content on the page. How to avoid this? Thank you. ...
0
votes
0answers
40 views

How to rewrite request for subdirectories using apaches' mod_rewrite?

My document_root is /home/john/public_html. I need the URL example.com/subdir/index.php to be handled by the file /home/john/public_html/index.php. This is what I put in ...
0
votes
0answers
31 views

Apache config for AllowOverride All in .conf file in conf.d not working

I have setup an Amazon EC2 LAMP server running Apache v2.2.29. I've loaded mod_rewrite and am trying to modify the entry to AllowOverride All. Rather than edit the httpd.conf file in the ...
0
votes
1answer
249 views

Arch-linux apache 404 mod_rewrite VirtualHost with url suffix

I have a problem with Apache on Arch-Linux. I assume it is related to mod_rewrite, but I am not sure. In the past I always worked with Debian-based systems. Arch seems a little different. I have a ...
1
vote
0answers
68 views

Convertion of htaccess rewrite rule to nginx [closed]

Through searching the internet with "converting htaccess to nginx rule" I came up with anilcetin and winginx .htaccess to nginx converter which I doubt it doesn't correctly output what I need. Which ...
0
votes
0answers
17 views

wordpress rewrite mess with mod_jk [duplicate]

I would like to run a wordpress site under apache and then a subpath e.g. http://example.com/tomcat/ will be served under tomcat. I have [compiled the mod jk ]: ...
0
votes
0answers
19 views

Mod-rewrite with GET [duplicate]

I'm trying to get my htacces to rewrite URLS with GET parameters but hopelesly failing. I'd like for this: domain.com/landingpage?variableone=true&variable2=false to be converted to this: ...
0
votes
1answer
33 views

Chain rewrites of Apache requests for VirtualHost to another server in same network

Here is basically what I would like to do: http request comes in, portforwarding in router sends it to a server in the local network (server A) the server identifies the request for a virtual host ...
0
votes
0answers
33 views

simple conditional mod_rewrite for redirecting wrong urls

I have an assignment to add storeId parameter to wrong urls. It should behave like this: If url has directorystore/a in it like www.example.com/store/a - the next directory in path has to be ...
0
votes
0answers
35 views

Apache mod_rewrite to remove slashes is writing redirect using the filepath not a uri

Unfortunately I don't have direct access to this server so trial and error via a proxy person is proving difficult. We have the following Location directive (along with others) within a VirtualHost ...
-2
votes
2answers
70 views

What will happen if I force https for my image hosting site via .htaccess but embed an image with an http link? [closed]

I've built myself a small image hosting service for my own projects and I recently switched the site to https which works perfectly. Now I made a .htaccess file with a rewrite rule as described here ...
0
votes
1answer
30 views

mod_rewrite combine these two rules into one

I have two rules that currently function as they should, but I feel like they can be consolidated into one for the benefit of a smaller config to maintain and less rules to process for each HTTP ...
0
votes
2answers
151 views

ProxyPass only if file doesn't exist

I've seen this example: RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://app_cluster%{REQUEST_URI} [P,QSA,L] I need a similar thing that will delegate to ...
0
votes
0answers
69 views

Apache Redirect Inconsistency

I have a website and visitors visiting the website at www.example.com should be redirected to example.com. However, instead an "infinite loop" was generated. When I look closer, I notice something ...
0
votes
1answer
38 views

Apache mod_rewrite rules aren't triggering?

I have an archive of the Twitch Plays Pokemon Reddit updates on my server (http://flarn2006.dyndns.org/tppupdates/). Some of them include links of the format "/u/username", which is valid on Reddit, ...
1
vote
0answers
39 views

Apache rewrite rule for multiple named virtual hosts with a 'catch all' rule

I have a redirect apache server that I setup for about 30 domains. I want to have all requests get redirected to the main server except for 1 domain. Basically any domain coming to this server gets ...
0
votes
1answer
218 views

Apache 404 returning 500 errors. Request exceeded redirects

I'm trying to setup a site with static HTML with Apache 2.2.22, but I'm getting a 500 error instead of 404. The message in the error log is: [Sun Dec 14 09:48:45 2014] [error] Request exceeded ...
3
votes
3answers
234 views

Block traffic behind AWS ELB

My web servers are behind ELB, I want to block traffic from some specific user agent which is a DDOS attack. Apache always see ip address of ELB as an end user so I tried below attempts: Blocking IP ...
0
votes
0answers
64 views

Rename file in apache

I maintain large files versioning on a server. Files are stored rewrited (hashed) on several folders, such as : For file test.avi : FOLDER1/aeriuyzekjshdfkjh FOLDER1/aeriuyzekjshdfkjh#1 For file ...
2
votes
0answers
60 views

Apache mod_rewrite rule to pass specific REQUEST_URI to specific html files

I have a very basic html presentation which I want to use Apache mod_rewrite to handle the URLs. home.html is just an intro page but I want this to be called when there is no REQUEST_URI ...
0
votes
0answers
37 views

301 redirect with mod-alias and mod-rewrite

my htaccess file has these lines: RewriteRule ^newlink ?do=something Redirect 301 /oldlink/ /newlink when i write http://www.example.com/oldlink/, browser redirects to ...
0
votes
1answer
61 views

How to get hostname into rewriterule [duplicate]

We've got a few subdomains setup, and I want to simplify some apache configuration - particularly as these particular subdomains are volatile. Anyway, I'm trying to get a rewrite rule that include the ...
1
vote
1answer
115 views

Does a wildcard subdomain (*.example.com) in Apache config also include the root (example.com)?

Does anything in an Apache config file (like ServerAlias, RewriteRule, ...) that has a wildcarded line like *.example.com also include the root example.com or do I have to separately add this ...
0
votes
1answer
105 views

Configuring a server-wide RewriteRule in conf-available

Lately I have been getting some referrer spam in my website's logs. In order to stop this (as it's quite annoying and also polluting my statistics), I want to block requests that are coming from ...
-1
votes
1answer
132 views

Excluding a directory from a root .htaccess rewrite rule to disallow from caching

On my lamp installation, I have in the root folder "/" (mydomain.org) a wordpress multisite with W3 total cache activated, I have also a sub_dir called "sub" (mydomain.org/sub) with a PHP script ...
-1
votes
2answers
69 views

Strip part of URI with mod_rewrite [duplicate]

I have this rewrite rule to direct request to my symfony 2 application: RewriteCond %{REQUEST_URI} ^/foo/.*$ RewriteRule ^/foo(/.*)$ /srv/webapps/symfony2/web/app.php [QSA,L] ...
3
votes
1answer
69 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 ...
0
votes
1answer
97 views

Apache proxy to Glassfish - How to supress subfolder in URL?

I've got a single linux server running Apache/2.2.24 running both HTTP/HTTPS along with a Glassfish 3.1.2 server listening on port 8080. Glassfish runs a single deployed application which has ...
2
votes
1answer
95 views

Can Apache .htaccess convert the percent-encoding in encoded URIs from Win-1252 to UTF-8?

I want to add a directive in my .htaccess, such that if the browser is pointed at a URI containing %E4 (ä) - or any other special character - the .htaccess automatically rewrites %E4 (ä) as %C3%A4 ...
2
votes
1answer
354 views

Blocking all users without referrer BUT allowing Googlebot/bingbot at the same time (with .htaccess)

Because of some amateur-made DDOS attack on my website, I had to deny some traffic with .htaccess which worked fine. Unfortunately, it also blocks the googlebot/bingbot: order allow, deny deny from ...
0
votes
1answer
27 views

.htaccess entry to return simple text based on the URI

I have URL http://foo.com/bar?abc=123, what would be the correct entry in the htaccess file to return a simple text 200 status of abc=123? Basically, I just want to return the entire query string as ...
1
vote
0answers
34 views

Apache2 mod_rewrite, handling the optional “/” at the end of a URL

I am attempting to host a single custom page to set as my homepage on my server. The real path to the page is example.com/start.html. However, I do not want this ugly URL in my homepage so I am ...