Tagged Questions

For an introduction and examples of using mod_rewrite, read over the comprehensive article, "Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask"

learn more… | top users | synonyms (1)

0
votes
0answers
19 views

Old rewrite rule persisting

I have the following .htaccess file ErrorDocument 404 /missing.php Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ ...
1
vote
1answer
20 views

How to set up .httaccess to subfolder

I have these structure on my FTP: one presentation (without .htaccess) second presentation (with .htaccess) - named "sec_pres" third pres. (with .htaccess) - named - "third_pres" How I should ...
0
votes
1answer
15 views

Can Apache conditionally perform a rewrite from a custom http header?

I have an apache server behind a (simple amazon) load balancer. I want to redirect any incoming traffic that is not 443 to 443. I would prefer it to use just one apache virtual host. So I'm trying ...
0
votes
0answers
25 views

How can i test for an environment variable in a RewriteCond

Is there a way to put an environment variable in the condPattern part of a RewriteCond? Here is what i tried: RewriteCond %{REQUEST_URI} /%{ENV:ALIAS}/(js|css|img).* RewriteRule (.*) - [L,NS] But ...
3
votes
1answer
39 views

Redirect /pagename to /#pagename

I would like to get the following apache-redirect working: When someone surfs to mydomain.tld/contact, they should be redirected to mydomain.tld/#contact. This is because I built a one-page-website ...
0
votes
1answer
22 views

htaccess url rewriting for 1 folder

My .htaccess file works fine for everything expect 1 specific folder. As result, http://www.mydomain.com/administration/index.php unexpectedly goes to 401 error page instead of loading index.php from ...
1
vote
1answer
40 views

mod_rewrite redirects for site root and subdirectory from HTTP to SSL

Ok, so I have two sites within the same webroot — the main site (in the root) and an unrelated bunch of files in a subdirectory. We would like both of these sites to force rendering under SSL. At the ...
0
votes
1answer
38 views

Apache subdomain redirection failing

I just bought the domain vas.im, I added a DNS rule for vas.im and www.vas.im, then I tried to get apache2 to redirect the latter to the former. I enabled mod_rewrite, appended ...
0
votes
2answers
48 views

Turn …/?token=xx-xxx into …/xx-xxx

I have a htaccess-file that removes index.php (codeigniter). I am having a problem with Paypal, cause the return url is using query strings, which are troublesome in codeigniter. This is my ...
0
votes
0answers
21 views

Php - mod_rewrite - shared hosting

I am wanting to move my website online and my website is not working on my shared hosting account, only to find out that module mod_rewrite was not loaded. I ran phpinfo ( ...
3
votes
1answer
33 views

How do I reset Apache's RewriteCond directive?

I have some Apache configuration like this: # Image hotlinking rule RewriteCond %{HTTP_REFERER} ^http://badsite\.com/ RewriteRule .*/static/artwork/.*\.(jpg|png)$ /static/images/hotlink.png [L] # ...
1
vote
1answer
36 views

Convert nginx to Apache rewrites

I'm trying to set up CodeIgniter from an existing site that's on nginx. My local machine is Apache and this is the redirect scheme on nginx. How do I write this using RewriteRules? if ($host ~* ...
0
votes
0answers
53 views

Virtual Hosts all Messed Up

I'm on OS X 10.6.8. I had two virtual hosts set up on my machine, http://site1.local and http://site2.local. Here's the Virtual Hosts file: <VirtualHost *:80> DocumentRoot ...
0
votes
0answers
27 views

rewrite HTTP verbs

I have a REST api that is invoked by a Javascript Web application. HTML/CSS and JS files are stored locally and served by Apache, and the REST api is invoked with a ProxyPass directive by Apache on a ...
0
votes
2answers
47 views

Cant get RewriteCond rule to work in mod_rewrite

I have the following path: http://www.domain.com/cgi-bin/hsrun.exe/Distributed/Postphil/postphil.htx;start=DetectLanguage?Language=LANG_Icelandic If the path contains the folder /postphil I want to ...
-1
votes
0answers
56 views

Socket interface to apache does not have HTTP headers, how to add them for PHP processing

I have a vendor front-end system (that I can not alter) sending socket requests with XML to my Apache server. The URL is index.php. There are no HTTP headers at all in the XML request. PHP is getting ...
0
votes
2answers
90 views

Why is https not working?

I am trying to redirect just the root of my site to https. Although the rewrite happens, https does not yield anything. The browser says. connecting to thinkingmonkey.me... and stagnates. ...
3
votes
2answers
74 views

How can I use apache to redirect users (based on user_agent and using mod_rewrite) to my mobile site only if a mobile pages exists.

I want to detect mobile users based on their user_agent. If a user is browsing the full version of the site and they have a certain user_agent, I want to redirect them (using mod_rewrite) to the ...
0
votes
1answer
34 views

HTML 5 Boilerplate HTACCESS Stopping my mod_rewrite from working

I'm using HTML5 BP's .htaccess file unedited. Everything works fine until I add my own rewrite rule: Options +FollowSymlinks RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f ...
1
vote
1answer
96 views

How to rewrite URI from root if file exists in folder?

I have a public folder in my document root. I would like to redirect all the files that are not present in document root, but are present in the public folder. (So if the same file is in two places, ...
0
votes
1answer
27 views

Redirect stylesheets through secure url to a different server

I have a domain http://services.mydomain.com which has a secure login through a secure central provider (https://secure.mydomain.com) on a different server with proxypass. When I go to the login page ...
0
votes
4answers
33 views

mod_rewrite redirects to www.example.com// when trying to access example.com

I have a VPS on which I'm trying to setup multiple websites. For one of them, with the current set of rules (below), accessing hxxp://example.com sends me to hxxp://www.example.com// [note the ...
0
votes
1answer
70 views

.htaccess not working but is enabled

I have a .htaccess file that isn't working. I know it's not working because i wrote random things in it and i am not getting a 500 error. Even when i write proper code it doesn't work. I have ...
1
vote
1answer
66 views

Redirecting users who have come from the wrong Referer

Ignoring the merits of whether we should make this change or not (the circumstances are slightly complex and probably covered by my NDA), our client would like us to require that visitors to the site ...
0
votes
2answers
119 views

Virtual hosts on apache to point domain.com, domain.net, domain.org to all go to domain.com

All of the names currently point to the same web server folder which is correct. That is, the domain.net, domain.org, etc all work without redirecting to the main .com How do I get visits to the .org ...
0
votes
1answer
80 views

Apache server different DocumentRoot for specific IPs [closed]

Possible Duplicate: Apache virtual host based on source IP For a certain visitor, identified by an IP, how to server contents from different DocumentRoot?
0
votes
1answer
45 views

How to get Apache to serve SSL Bugzilla CGI from a subpage (NOT subdomain)?

I'm trying to set up Bugzilla with SSL to be served by Apache from https://www.foo.com/bugzilla since I don't want to pay for an extra SSL cert to get a subdomain for bugzilla. What is the best ...
3
votes
1answer
102 views

Forcing SSL in Apache without hard-coding the hostname

I think that I have this sorted (thanks mainly to the question How to redirect non-www to www without hardcoding using .htaccess?), but I still don't entirely understand a couple of things. I would ...
0
votes
1answer
168 views

Why does this pattern not match QUERY_STRING in RewriteCond while it matches in preg_match?

Here is what I have in my .htaccess file. RewriteEngine on RewriteCond %{QUERY_STRING} ^(run=[a-z0-9A-z]{13})$ RewriteRule %{QUERY_STRING} \? [L] All I am doing is Rewriting the QUERY_STRING for ...
2
votes
1answer
53 views

Why is the RewriteBase not working?

Here is what I am trying to do: domain is thinkingmonkey.me domain has 127.0.0.1 as IP addr mod_alias is installed. I have a conf file called directories.conf. In which I have all the ...
0
votes
2answers
37 views

mod_rewrite `Redirect` how?

I have 2 urls say thinkingmonkey.me and thinkingmonkey.com both have ip-address 127.0.0.1 (A.K.A localhost). I want to redirect any requests to thinkingmonkey.com to thinkingmonkey.me. ...
2
votes
1answer
77 views

Rewriting to https without a certificate?

Our environment looks as follows: HLB (Ace) --> redundant Apache servers --> Backend Websphere servers Secure Traffic coming into the Load Balancer, where the SSL Certificate is decrypted. The ...
0
votes
0answers
27 views

using mod_auth_openid, but need to swap REMOTE_USER value with querystring attribute

I have a web app which uses mod_auth for user authentication, however I would like to move to authentication via openid against the google openid provider and use the mod_auth_openid module - ...
0
votes
1answer
70 views

(Probably) Simple mod_rewrite - remapping my site's URLs

This problem is driving me nuts. I've tried reading loads of tutorials about how to use mod_rewrite but I just can't get my head around it. These questions must get asked all the time, so apologies ...
0
votes
1answer
19 views

Mod_rewrite excluding files/directories but including .php files

The traditional mod_rewrite for routing is as follows: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L] ...
0
votes
2answers
100 views

Apache Virtual Host with Alias

I have a virtual host running on my local copy of Apache. It has an alias. <VirtualHost 127.0.0.1> ServerName oliverash.me.dev DocumentRoot "/usr/docs/oliverash.me/public" ...
1
vote
1answer
30 views

Is it possible to have dynamic proxy_remote_match directives in apache2 or work around it somehow?

I am running a forward proxy, where I want to forward certain requests to different proxy servers using ProxyRemote. Which request goes to which server depends on many factors (time, load, url, host, ...
1
vote
1answer
70 views

Load balancing based on client certificate with Apache mod_proxy_ajp and Tomcat

Currently, I am using mod_proxy_ajp to load balance requests to multiple Tomcat servers. Callers are authenticated using client certificates and an ACL. This has been working fine, callers are routed ...
0
votes
1answer
32 views

Apache mod_rewrite 500 Internal Server Error

I am trying to create a dynamic subdomain and I am having great difficulty, I keep getting 500 Internal Server Error So for example the actual domain should be ...
0
votes
1answer
125 views

URL with trailing slash 404, appending index.php or ?someString works

Recently I've encountered an issue where some pages 404 when accessed via their cruftless paths. The same pages work when a query string, like ?1234 or index.php is appended to the path. Example: ...
0
votes
1answer
37 views

htaccess rewrite rule

Well i have this code into my .htaccess file Options +FollowSymlinks RewriteEngine on AddDefaultCharset UTF-8 RewriteCond %{THE_REQUEST} ^[A-Z]+\ (.+)\.php [NC] RewriteCond ...
1
vote
0answers
34 views

htaccess rewriterule [closed]

Possible Duplicate: htaccess rewrite rule Well i have this code into my .htaccess file Options +FollowSymlinks RewriteEngine on AddDefaultCharset UTF-8 RewriteCond ...
0
votes
0answers
33 views

Shared SVN-powered web development with branching on Apache

We're a web development shop and have our sites checked out from SVN on a single development server via samba, like this: share/ site1/ trunk/ site2/ trunk/ branches/ ...
0
votes
1answer
163 views

.htaccess working on remote server but does not work on localhost. Getting 404 errors on localhost

MY PROBLEM: When I visit localhost the site does not work. It shows some text from the site but it seems the server can not locate any other files. Here is a snippet of the errors from firebug: ...
0
votes
1answer
86 views

mod-redmine && mod-passenger: Passenger refuses to load (here: Redmine) after rewrite uri. Where to put RailsBaseURI?

i've a working Redmine-instance at /var/lib/redmine. (Redmine configuration is not the issue) ln -s /var/lib/redmine/public /var/www/redmine chown -R www-data:www-data /var/www/redmine echo ...
0
votes
0answers
41 views

apache mod_rewrite subdomain, domain and url arguments

I am trying to use mod_rewrite to capture a subdomain, domain, and the arguments passed with the url. I have multiple domains pointing to a single ip address, with both @ and * wildcard a-records, so ...
0
votes
2answers
48 views

Unable to get mod_rewrite to stop processing

This is linked to Rewriting subdomain.domain.com when other 'subdomains' exist I need mod_rewrite to 'stop' processing, but it seems to continue on. On my registrar, I've set A records as: ...
0
votes
0answers
45 views

mod_rewrite not working with serveralias

TL;DR: Apache is not processing urls for server aliases. Details: I am trying to set up a wordpress multisite (a feature of wordpress 3.+ which allows to host multiple blogs at once). The main ...
0
votes
1answer
62 views

Rewriting subdomain.domain.com when other 'subdomains' exist

My httpd.conf looks like this: NameVirtualHost 12.34.56.78:80 <VirtualHost 12.34.56.78:80> DocumentRoot /var/www/html/site ServerName www.example.com <IfModule mod_rewrite.c> ...
1
vote
1answer
24 views

mod_rewrite file check with extention

Here is my .htaccess for simple url rewriting for any MVC architecture. Options +FollowSymlinks RewriteEngine On RewriteBase /personal/site/ RewriteCond $1 !^(index\.php|resources|robots\.txt) ...

1 2 3 4 5 17