URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
15 views

How do I prevent RewriteRules conflicting

I have three RewriteRules I am trying to implement but I cannot get all 3 to work together: RewriteRule ^products$ http://%{SERVER_NAME}/en_ca/products [L,R=301] RewriteRule ^products/(.*)$ ...
2
votes
1answer
46 views

Thousands of requests with non-existent domains as HTTP_REFERER [duplicate]

For the last few days one of my websites has been receiving hundreds of requests per minute with non-existent random domains as HTTP_REFERER and from different IPs (therefore using deny from IP is not ...
3
votes
1answer
591 views

Htacess rewrite for AngularJs App

I need help regarding AngularJs application. I need htacess file for HTML5Mode in AngularJS and Hashbang fallback. Can someone help me? Cuz i get %2F when i use backslash. I've been folowing along ...
0
votes
1answer
192 views

Use of ProxyPassReverse to change Location response header

I am implementing a reverse http proxy: proxy.example.com This will forward requests to servers based on URI: proxy.example.com/server1 -> server1.example.com When a user requests ...
0
votes
1answer
54 views

Apache Mod Rewrite - exclude folder and subfolders, except for one subfolder

I have a Mod_Rewrite setup as follows: RewriteCond %{REQUEST_FILENAME} !^/www/live/site.name/app/public/(/forms/|/crm/) RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f ...
2
votes
1answer
100 views

Apache RewriteRule 502 Error on dev server, works on live

I'm on Apache 2.2.15. My vhost.conf contains a RewriteRule to handle article URLs; # handling for neat article titles RewriteRule ^/news/[0-9]{4}/[A-za-z]{3}/([0-9a-zA-Z-]*)/([0-9]{4})([0-9]{6})/?$ ...
0
votes
1answer
61 views

.htaccess: RewriteRule: bad flag delimiters

I added RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} /article/ RewriteRule ! ^article/\d+ redirect.php [L] to .htaccess and got a .htaccess: RewriteRule: bad flag delimiters ...
0
votes
2answers
17 views

Apache Mod Rewrite direct delevering content

i would like to know if it is possible to send a 200 status with a page content without passing by a status 30x ? exemple or rewrite condition: RewriteCond %{HTTP_USER_AGENT} ^-?$ RewriteCond ...
0
votes
0answers
57 views

mod_rewrite hide URL params

I have the following URL: www.mydomain.com/musician.php?musician=musicianname&id=idnumber I am using mod_rewrite to achieve this: www.mydomain.com/musician/musicianname/idnumber This is the rule ...
0
votes
0answers
10 views

Weird request, trying to correct with rewrite rule

I've got some really weird requests coming into the site. We've tried replicating in all browsers, mobile, tablets, etc etc... but still can't figure it out! As an intermediary, we are trying to force ...
0
votes
1answer
68 views

Sanity Checking mod_rewrite for Apache 2.2 on Ubuntu 12.04

Summary: I'm testing a simple catch-all rewrite rule. It doesn't seem to be taking effect, it's not being logged and I'm not getting any errors. I'm a junior server administrator trying to gain a ...
-1
votes
1answer
32 views

RewriteRule running after Require test failed which rewrites 403.shtml to website content instead of error message

When a request gets denied due to require all denied, it first gets routed to the ErrorDocument 403.shtml but then that gets rewritten rather than stopping there and the site content actually gets ...
0
votes
1answer
18 views

RewriteRule [E=let_me_in] and 'Require env let_me_in' don't work together

I have a problem similar to this: http://www.tek-tips.com/viewthread.cfm?qid=1144803 I'm trying to grant access, if specific RewriteRule triggered. Setting a var using [E] flag, but the var seems ...
-3
votes
2answers
31 views

apache conf entry does not work but does in .htaccess [closed]

i am running: Server version: Apache/2.2.15 (Unix) i have a custom security conf file on a shared server. i placed the following entry at the top of the file with no joy, and i also placed it at ...
0
votes
2answers
19 views

forbid cgi invocation by direct url, but allow via a RewriteRule

I want to allow anonymous client execute a script via a special URL, but not directly. Everything else should require auth. <Directory "/srv/http"> Require all granted </Directory> ...
1
vote
1answer
112 views

How to internal redirect from one virtualhost to another Apache [duplicate]

I'm upgrading my application to new PHP version. For that I created two virtualhosts one server PHP 5.3 application and another with PHP 5.6. My virtualhosts are like, <VirtualHost *:80> ...
0
votes
0answers
51 views

How to get a useful error about failed .htaccess redirects?

I am trying to set up a test server on localhost for a LAMP app that's already live, in order to allow my team to write and test some new features. On a vanilla installation of Fedora 22, I have ...
0
votes
1answer
23 views

How is leading slashes handled in server and in client?

I am trying to create a RewriteRule, but it's unreliable and I can't figure out what is happening. Here's my rule: RewriteRule ^docs/(......)/$ index.php?docid=$1 [L] the problem is leading ...
0
votes
0answers
12 views

Apache RevProxy and Webapp with subfolders

I would like to extend my current RevProxy. By a subfolder (www.example.com/subfolder) I would like to make an small webapp available. Here is my configuration from RevProxy: ProxyPreserveHost ...
1
vote
1answer
28 views

Redirect to HTTPS and subdirectory is visible [duplicate]

I am forcing HTTPS and redirecting to subdirectory with: RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301] RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR] ...
1
vote
2answers
44 views

mod_rewrite: web page has a redirect loop [duplicate]

I'm trying to have a parameter that comes just after he hostname, as in: www.domain.com/parameter For this reason, I've set the following rewriteRule, for two parameter values that I'd like to ...
0
votes
1answer
16 views

.htaccess not behaving as desired

Eventhough I'm new at htaccess, I've been learning a lot in the past few days, but I'm stuck on a certain part that resulted in the website not behaving as desired. Here is the part of the code where ...
2
votes
2answers
187 views

Special characters in URL causes custom redirect to fail

I have a domain on which I am trying to set custom redirects for the error pages. My .htaccess file looks like so: RewriteEngine On AddDefaultCharset UTF-8 DefaultLanguage en-US # disable TRACK and ...
0
votes
1answer
42 views

System error in Apache with combination of https redirection plus password requirement plus error document

In an Apache 2 vhost I have the following configuration (in my case, in .htaccess of the document root (which is for simplicity the same for http:80 and https:443) RewriteEngine On RewriteCond ...
-2
votes
2answers
74 views

apache virtual host config

hi im trying to ensure that my website is only accessed via https, and only through the www sub domain, im currently using the following apache virtual host config: <VirtualHost *:80> ...
0
votes
0answers
74 views

Apache reverse proxy rewrite failing to mask internal URL

I am having an issue setting up a Reverse proxy scenario to an internal URL authentication service. Using Apache I have setup the below - ProxyPass "/mqa/login/" ...
0
votes
0answers
133 views

Prerender with my angular application

ive asked this question on Stackoverflow and got suggested to try here so i am hoping some of you can help: I have followed the following guide: In angular: $locationProvider.html5Mode(true); In ...
-1
votes
1answer
45 views

Mod rewrite regex htaccess

I've been using mod_rewrite in order to block some user agents but now, I'm getting an 500 Error and error_log: /var/www/htdocs/.htaccess: RewriteCond: cannot compile regular expression I think ...
0
votes
1answer
98 views

Redirect to Maintenance file with .htaccess

i'am trying to do a simple redirect to a maintenance page, but seems like apache won't let me do ! i have a folder for 3 version of a wiki (each with a specific language), so i want to redirect each ...
1
vote
0answers
55 views

Using Apache mod_rewrite to rewrite host to subfolder, but it redirects instead of rewrite

I want to simulate virtual hosts by .htaccess, so I want to rewrite hostname to subfolder. It works, but on some URLs it don't rewrite but redirects. This is my .htacess file: RewriteEngine on ...
1
vote
1answer
59 views

static resources not found when mod_rewrite

I am trying to beutify the url so I have created the following .htaccess file: Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f ...
0
votes
0answers
70 views

forward slash and mod_rewrite

This might be a stupid question but it took me days to even figure out what the problem was. I'm using mod_rewrite and passing values separated by forward slashes. The problem is that the forward ...
0
votes
0answers
13 views

Find file in more directories in .htaccess [duplicate]

We migrated our old site and I need to redirect old files to new locations. I have this rewrite condition and rules to display image from another directory when doesn't exist in first directory. ...
0
votes
2answers
35 views

mod_rewrite gives 404 error [duplicate]

I'm making a CMS and trying to convert post links to pretty ones like so: Original Link: http://localhost/index.php?id=13&category=Uncategorized&title=just-a-link Converted Link: ...
1
vote
0answers
52 views

Use different client IPs with mod_rewrite and mod_remoteip

I have a reverse proxy that my site points to to help with DDoS protection. I have mod_rewrite set to use a specific header provided by the reverse proxy in order to pull the actual client IPs instead ...
-2
votes
1answer
69 views

apache: prepend a string literal to a TestString in a RewriteCond for mod_rewrite [duplicate]

So I can clearly do this: RewriteCond %{REQUEST_FILENAME}\.php -f But I cannot do this: RewriteCond some_directory/%{REQUEST_FILENAME}\.php -f Furthermore, this also fails: RewriteCond ...
-1
votes
1answer
76 views

How to mask one of my domains to another? [duplicate]

I want one of my domains (freelawofattractioncourse.com) to point to another site of mine (http://katievb.com/freecourse) without causing the URL to change in the address bar. In other words, when a ...
0
votes
1answer
35 views

mod_rewrite sending redirect loop when trying to redirect based on user agent

I am using Apache 2.2.3 (old version, I know) So I am trying to redirect based on older versions of IE (6 and 7 for now... ) and I am getting a redirect loop. I have: RewriteEngine On RewriteCond ...
0
votes
0answers
27 views

Redirect from different domains on SSL without URL rewriting

Problem I have two domains hosted on hostgator (on different servers): Domain A is using cloudflare for DNS and flex SSL. This is hosting a product page with info about product. Domain B is using ...
1
vote
1answer
96 views

Conditionally serving files from a directory outside of the document root with Apache2

I have inherited a web application written in PHP. The code is not the best and I want to start using the Symfony framework. It will be a gradual migration through several releases so I need the ...
1
vote
1answer
52 views

Redirect rules for .htaccess with mod_rewrite

I have a PHP script dynamically generating content from a database based on queries. The user might do a search from a text box for the username "mark". The content is provided by PHP at ...
2
votes
1answer
43 views

404 when trying to shorten url for mediawiki (lighttpd)

I'm absolutely new at this, so please bear with me. I installed mediawiki on lighttpd with no problems, except that when I try to follow up redwerks instructions on how to shorten the urls for ...
0
votes
1answer
20 views

How to write more than one mod-rewrite rule? [duplicate]

I always used the following rule to manage urls: Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^.*$ ./urlredirect.php ...
0
votes
0answers
100 views

Apache 2.4 mod_rewrite on vhost_alias

i have configured apache as dynamic mass virtual hosts. I have serval applications writen in symfony2 with .htaccess Vhost looks like this: <VirtualHost _default_:80> ServerAdmin ...
0
votes
1answer
37 views

Some mod_rewrite syntax clarification

We inherited some code recently and I'm reviewing the .htaccess file of one of the sites. I understand what the end result of most of the rewrite rule sets are, I'm just unsure of some of the syntax. ...
0
votes
0answers
58 views

Combine modrewrite condition to avoid double redirects

There are two modrewrite directives in my htaccess file. One is redirecting uppercase URLs into lowercase. The other one is redirecting http and www requests to https and none www. #Redirects ...
0
votes
0answers
5 views

Apache config with rewrite causes loop [duplicate]

I have to port a WebApp to a new server. On both servers I use the Apache 2.x webserver. I have to redirect every user from m.domain.com/$restOfPath to m.domain.com/mobil/$restOfPath. With ...
1
vote
1answer
104 views

How can I force mod_rewrite to send user info component of a URI?

A colleague recommended I repost this from StackOverflow to ServerFault: This has been driving me crazy. I have a web application that's being served via Apache Web Server. The database server that ...
1
vote
0answers
24 views

Apache rewrite not finding path

I am trying to rewrite an internal path for specific requests. I have the following URL: ...
2
votes
2answers
220 views

RewriteRule for root without the R flag is not working

I'm trying to do a cache system with files. And I was thinking of using mod rewrite to serve the cached file if it exist, or the php file (that will create the html static cache) if not. Here is the ...