URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
202 views

Server remembering old rewrite rules, even when I remove htaccess

I have set up a development server with Ubuntu and LAMP, but for some reason the .htaccess is acting strange... There is a site on there with a set of rules, when I comment them out they still work, ...
1
vote
1answer
1k views

How to get apache to look for files in different subfolders folders?

I am definitely new to mod-rewrite stuff. Note:- here the URL is common, and all the folders and subfolders on same host. The url a user uses to access their page is ...
0
votes
0answers
9 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> ...
1
vote
0answers
9 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 ...
7
votes
3answers
972 views

RewriteCond file-exists check fails for existing files

I have a weird scenario with this rewrite rule: RewriteCond img/$2/$3/$4/$1 -f RewriteRule ^img/(([a-z0-9]{4})([a-z0-9]{4})([a-z0-9]{4})[a-z0-9]{28}\.\w+)$ img/$2/$3/$4/$1 [L] The directory ...
0
votes
1answer
153 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 ...
4
votes
3answers
53 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
3answers
2k views

Apache > 2.2.22 rewrite rule not working?

since yesterday I'm trying to figure out how to fix the following: running phpipam (http://www.phpipam.net/) with WAMP (Windows environment). The problem I am facing is related with RewriteRule ...
3
votes
1answer
36 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
44 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 ...
0
votes
2answers
831 views

Server, Database or Code Issue? Magento backend rewrites itself with a index.php which doesnt work

I will be honest and admit my cross posting in magento.stackexchange.com but the reason is that I believe it is a server fault, and now I am looking for proof to present to my dreaded hosting ...
4
votes
1answer
1k views

Apache Mod_rewrite rule working on one server, but not another

I am using mod_jk and mod_rewrite on httpd 2.2.15. I have a rule.... RewriteCond %{REQUEST_URI} !^/video/play\.xhtml.* RewriteRule ^/video/(.*) /video/play.xhtml?vid=$1 [PT] I just want to rewrite ...
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 ...
1
vote
0answers
32 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
1answer
21 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 ...
0
votes
0answers
28 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 ...
0
votes
0answers
10 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
2answers
904 views

apache - query string rewrite rule appends condition to URL

In trying to rewrite site-search.html?searchword=search%20term as advanced-search#q=search%20term I always end up with advanced-search#q=%3Fsearchword%3search%20term The %3Fsearchword%3 ...
1
vote
1answer
81 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
2answers
1k views

How to add an additional RewriteCond to exclude a specific url?

I have an existing .htaccess file with the following rewritecond: RewriteCond %{HTTP_HOST} !^go\.domain\.com$ [NC] RewriteRule ^(.*)$ https://go.domain.com [R,L] In essence, everything on this ...
0
votes
1answer
19 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 ...
0
votes
2answers
1k views

Ubuntu, apache2 wildcard dns to subdomain

Currently I'm hosting my own (ubuntu) server with the following services: samba, ftp and a webserver. I've bought a domain and linked the DNS A-record to my ISP's IP. This is working correctly. Now ...
2
votes
1answer
802 views

Reverse Proxy (mod_rewrite) and Rails (absolute paths)

I have front end rails app, that reverse proxies to any of a number of backend rails apps depending on URL, for example http://www.my_host.com/app_one reverse proxies to ...
-1
votes
1answer
42 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 ...
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 ...
0
votes
1answer
33 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 ...
0
votes
0answers
13 views

Rewrite condition on apache with ezpublish [duplicate]

I have a problem with setting up my rewrite rules on apache. I work on centos 6 with apache and ezpublish. I own the domain example.com and I have things set up like below: www.example.com/support ...
-1
votes
2answers
38 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] ...
0
votes
1answer
858 views

Apache ProxyPass/RewriteRule with p flag: Return no content when response has multi-part content type i.e.images

This is a continuation of a previous question which has been implemented with a little change. Following is the structure I am going to talk about. My goal is to create the Tunnel/Proxy. ...
0
votes
2answers
957 views

Using Apache httpd to redirect context path?

I'd like to proxy http://localhost:1006/ as http://example.com/public/ to the outside world. Here is my configuration: RewriteEngine On # Append a slash if necessary RewriteRule ^/public$ public/ ...
0
votes
0answers
26 views

Cannot set up mod_rewrite with XAMPP [migrated]

I'm trying to enable mod_rewrite on a XAMPP 5.6.3 installation. I've been following these guides: http://www.leonardaustin.com/blog/technical/enable-mod_rewrite-in-xampp/ ...
4
votes
5answers
8k views

apache server-status not found. check if mod_status is enabled

I've enabled the apache_ plugins on a munin node: ln -sv /usr/share/munin/plugins/apache_* /etc/munin/plugins/ After restarting the node with service munin-node restart here are the errors I'm ...
2
votes
1answer
38 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
53 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
15 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 ...
0
votes
1answer
18 views

apache mod_rewrite scenario subdomain capturing from the http_host and passing it as subdomain to other url while rewriting it [duplicate]

i am trying to write two rewrite rules which are PASS THROUGH or PROXY so that i can hide the underlying url. Case1: When a request comes to app.domain.com/folder1/folder2/ it should go through ...
1
vote
0answers
22 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 ...
1
vote
2answers
1k 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 ...
0
votes
1answer
15 views

Apache2 retrieve files from another folder when not found

While working on an application rewrite, I'd like to keep the old app webroot files as a fallback, when the new files are not found. There are 2 applications: <VirtualHost *:80> ServerName ...
-6
votes
0answers
37 views

Convert Nginx rewrite to htaccess [duplicate]

Nginx rewrite: if (-d $request_filename) { rewrite ^/?$ /get_doc.php last; break; } if (!-e $request_filename) { rewrite ^/?admin /get_admin.php last; rewrite ^(.*)$ ...
0
votes
1answer
59 views

Force SSL for every URL except one path using .htaccess

I'm trying to enforce SSL for every URL except one with the first segment /preview. http://test.example.com/preview/blah/blah should be ignored by the rule; every other URL should be forced to use ...
0
votes
0answers
10 views

Rewrite old mediawiki URL pattern to short URL format and rewrite old URLs to support new format [duplicate]

We have been running a mediawiki installation for some years now. During an upgrade to a newer version, we decided to switch to the short url pattern wikipedia uses. This is working fine. So our ...
1
vote
3answers
912 views

Empty rewrite.log on Windows, RewriteLogLevel is in httpd.conf

I am using mod_rewrite on Apache 2.2, Windows 7, and it is working ... except I don't see any logging information. I added these lines to the end of my httpd.conf: RewriteLog ...
0
votes
0answers
7 views

wrong REQUEST_FILENAME if subfolder has the same name as the host

I got the following problem: I have a local wamp server with a virtualhost called admino. The needed vhost-info for that host is: <VirtualHost *:80> ServerAdmin arne@gmail.com DocumentRoot ...
0
votes
0answers
21 views

Apache rewrite isn't redirecting on ec2

I'm using Elastic Beanstalk with Amazon. I'm trying to setup Apache virtual host on the ec2 instance. No matter what I try, it doesn't seem to work. I'm using the following examples. ...
0
votes
1answer
78 views

Joomla URL Rewriting works automatically in Nginx

This is driving me nuts and I dont understand how this works automatically. I have nginx as my web server and I have installed Joomla that has URL Rewriting which removes the index.php from the URL. ...
0
votes
0answers
26 views

Apache Alias and Mod_Rewrite For WordPress?

I have a site that is running WordPress, anothersite.com, and I am trying to access that site through a different domain, mydomain.com. The goal is to have mydomain.com/anothersite act just like it ...
0
votes
1answer
23 views

Include more than one file in negative RewriteCond

I'm using this rule to ignore index.php in rewritte rule: RewriteRule ^((?!index\.php)[^/]+)/?$ galeria.php?nome=$1 [L,QSA,NC] But I need to include bio.php and contact.php in this rule. How can I ...
0
votes
2answers
33 views

Apache Alias to link to another DocumentRoot

I have a WordPress installed in /var/www/wordpress/ and my own code in /var/www/project/ Now comes the following problem: When I try to access example.com/client/ or example.com/admin/ it should link ...
0
votes
0answers
34 views

Converting .htaccess to lighttpd rewrite rules for Chevereto

I am trying to translate Apache2 htaccess rules to lighttpd rewrite rules. My lighttpd version is 1.4.33. Chevereto uses the G\ php microframework. Apache2 htaccess rule i am trying to convert: ...