URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
89 views

Apache reverse proxy logic based on arbitrary header

I have apache running on a natting fw, that authenticates, reverse proxies, and provides an ssl wrapper for 2 webapps on the back end. This works with virtual hosting and proxies back based on the ...
0
votes
1answer
105 views

URL rewriting/redirecting with two parameters

Basically, I want to have this URL: http://domain.tld/auth.php?state=somestate&token=somelongtoken rewritten/redirected into this: http://domain.tld/auth/validate/somestate/somelongtoken I ...
1
vote
0answers
179 views

htaccess, errordocument and joomla rewrite

I need to setup a 404 error handling in my .htaccess, besides handling some 301 redirects for the links of an old website. The new site is made with Joomla, the old site was written in asp. Sef urls ...
0
votes
1answer
258 views

SSL/TLS Client certificate Authentication using RewriteCond and Rewrite Rules to perceptively redirect traffic not authorized

I finally end up to write here because I´m badly struggling against apache, SSL/TLS and a client certificate authentication that should use the certificate´s Serial Number to restrict access to a ...
2
votes
1answer
167 views

Why does mod_rewrite not reprocess rewritten paths?

I'm doing a path rewrite to set and environment variable that will cause mod_jk to use a specific JBoss server. Works perfectly with any of the application paths. When I try our monitoring servelet ...
0
votes
1answer
46 views

add word in url using .httaccess

Right now i am accessing abc.xml from test directory as below http://localhost/test/abc.xml I want to redirect the above url as below http://localhost/test/test.php?abc.xml ...
1
vote
1answer
222 views

RewriteRule not working with mod_userdir

My setup: Ubuntu 13.04 Apache/2.2.22 (Ubuntu) PHP 5.4.9-4ubuntu2.2 -- $ ls /etc/apache2/mods-enabled/*.load alias.load auth_basic.load authn_file.load authz_default.load ...
3
votes
2answers
624 views

Apache configuration - rewrite rule for all virtual hosts

I have the following configuration with 2 virtual hosts on my Apache: www.domain.com and res.domain.com. The first one is open the second is limited to registred users. <VirtualHost *:80> ...
0
votes
2answers
61 views

Apache Proxy to show another Website

I need to proxy the URL http://de.domain.com/article1/foobar/ to http://de.foobar.domain.com/article1/. How can I do this within getting and setting the subdomain language part? Examples: ...
1
vote
2answers
70 views

Can you please explain substitution in RewriteRule

I have the following statements in an .htaccess file RewriteCond %{HTTP_HOST} ^myOldDomain\.com$ [NC] RewriteRule ^(.*)$ https://myNewDomaink.com/$1 [R=301,L] It works fine. I basically found some ...
0
votes
2answers
392 views

Main domain is redirecting to subdomain

I've a domain domain.com and made one sub domain 'forum.domain.com'. I'm using Apache2 and added one A record to the dns records and made virtualNameServer as: <VirtualHost *:80> ServerName ...
2
votes
1answer
138 views

Rewriting the whole URL using mod_rewrite

I know how to use Apache's mod_rewrite in a common way but now I'm trying to use it in a different way which was not a success to this moment. Here's what I wrote: RewriteEngine on RewriteMap ...
0
votes
1answer
42 views

Drop Port Number on Apache Redirect Rule

I am trying to figure out a rewrite rule to drop port 81. I am using no-ip and so the request hits port 81 and then i have a rewrite rule to redirect to SSL. Now it looks like https://example.com:81 ...
1
vote
1answer
521 views

Make mod_rewrite rules process before fcgi sees the request

Is there a way to have the mod_rewrite rules in my .htaccess file take effect before PHP behind fcgi sees the request? I have an email validation link that I want to redirect from root to the login ...
0
votes
1answer
47 views

local apache2 adds trailing slash

I am currently trying to get a webpage of mine running on my local machine. Strangely though, albeit I do use the exact same Directives and RewriteRules, what works on my server, does not work on my ...
1
vote
3answers
443 views

Index.php downloads instead of opening

Ok, so I have a server at work that I am setting up sites on. It has a Wordpress site in the root, a phpBB forum in a child directory, and a support site in another directory. I'm able to access both ...
0
votes
1answer
34 views

Inspecting apache mod_rewrite

I want to do something simple with apache mod_rewrite. And guess what, it doesn't work. Had I been in a "sane" environment, maybe I would get an error and a stack trace. Or maybe I could use a ...
1
vote
2answers
1k 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/ ...
1
vote
1answer
282 views

Apache as a proxy fowarder to dynamic IP

I've looking aroung the web, but I can't figure out how to do what I'm looking for. So what I'm looking for is a proxy on which will foward the HTTP query based on the IP address I've put in the url ...
3
votes
1answer
67 views

Secure Apache when using mod_proxy_http and mod_rewrite

We have an Apache server that works as a proxy for apps running on different ports. For example: domain.com/app1/service1 > localhost:101 domain.com/app1/service2 > localhost:102 ...
4
votes
3answers
1k views

How do I create a custom header from an existing SSL environment variable?

OK I have spent all day on this-- I'm using apache with mod_ssl I'm trying to take an existing environment header, "%{SSL_CLIENT_S_DN_CN}s" which looks like "Lastname Firstname Mi username" and set a ...
0
votes
2answers
7k views

Removing php extension with .htaccess does not work

I use the following code on my site elixnews.com to remove php extension from: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
1
vote
1answer
380 views

trac: “Internal server error (500)” with mod_fcgid and mod_suexec

I try to setup Trac on a shared server with shell access, SW is Trac 1.0.1, Python 2.6.6, Apache 2.2.15 with mod_fcgid and mod_suexec. I've set it up following the instructions from the wiki of my ...
0
votes
1answer
16 views

Issue with mod rewites in htaccess on Apache

I am using a private host, linux php, where the htaccess just does not act like it does with the bigger famous top 10 hosts etc. redirect 301 /pagea.html /pageb.html Causes a 500 internal error on ...
-1
votes
3answers
61 views

RewriteRule doesnt work [duplicate]

I want to convert this url http://ts.thebenamorgroup.com/g2g/category.php?cate=mens to: http://ts.thebenamorgroup.com/g2g/category/cate/mens/ I have this rule but it doesnt work: Options ...
0
votes
2answers
646 views

RewriteCond RequestURI why RegEx doesn't work?

i have a working RewriteCond like: RequestURL: http://www.myserver.com/images/gallery/summer/2013/2013-07-07/thumbs/001.jpg RewriteCond %{REQUEST_URI} !images/gallery/summer/2013/* RewriteRule ...
1
vote
1answer
313 views

Debugging htaccess rewrite rule; 2nd capture group ($2) empty

I've seen this issue crop up for other people, but in their cases, there was an issue with their regex. A quick trip to regexpal.com indicated to me that this was not the case. I have a simple ...
0
votes
1answer
206 views

mod rewrite on apache on virtualhost to point to jboss

I set my apache server with ajp to connect to my jboss server and it is working fine. But when I go to my domain http://mydomain.com, I see the jboss root page. I was wondering if I could use mod ...
1
vote
1answer
133 views

How to store value of a non-standard HTTP request header to be used in an Apache If conditional

My server will be receiving a non-standard HTTP request named EmployeeID that I want to use to determine access rights to certain directories on the server. How can I store the value of the incoming ...
0
votes
1answer
318 views

apache2 mod_rewrite enable, but not working

I have enabled mod_rewrite on my server and confirmed it using phpinfo() and it shows as enabled. I have the following in my httpd.conf file: ServerName 172.16.1.114 RewriteEngine on RewriteRule ...
0
votes
1answer
477 views

Mod_rewrite issue with godaddy web hosting

Am trying to use laravel to build a site but my routes all redirect to the homepage. Apache error logs show this AH00124: Request exceeded the limit of 10 internal redirects due to probable ...
0
votes
1answer
71 views

mod_rewrite capturing domain and tld

I'm using mod_write to rewrite this www.variabledomain.variableext to http://my.com/variabledomain.variableext Note that variabledomain and variableext are really variable, so I can't hardcode ...
0
votes
2answers
218 views

How to simulate Apache [END] flag on a redirect?

For business-specific reasons I created the following rewrite rule for Apache 2.2.22 (mod_rewrite): RewriteRule /site/(\d+)/([^/]+)\.html /site/$2/$1 [R=301,L] Which if given an URL like: ...
0
votes
2answers
464 views

How can I rewrite a URL and pass on the original URL as a parameter?

I'm building a site that needs to include a 'check' procedure, to do several initiation tasks for a user's session. Examples include checking whether they're accepting cookies, determining if their IP ...
2
votes
2answers
3k views

How to Exclude an URL for Apache Mod_proxy?

We have two Apache server as front-end and 4 tomcat server as back-end configured using mod_proxy module as load balancer. Now, we want to exclude an single tomcat url from the mod_proxy load ...
-1
votes
1answer
27 views

Include current rewritten URI in substitution

Without changing my patterns to match the whole string (which would make them a lot more complicated), is there a way to use the current URI in the substitution string? Using %{REQUEST_URI} won't ...
1
vote
1answer
1k views

.htaccess ignored, SPECIFIC to EC2 - not the usual suspects

I run 8-10 EC2 based web servers, so my experience is many hours, but is limited to CentOS; specifically Amazon's distribution. I'm installing Apache using yum, so therefore getting Amazon's default ...
0
votes
1answer
67 views

mod_negotiation and mod_rewrite

I'm trying to configure a URL scheme that a) allows the ".html" extension to be omitted and b) sends 403 (Forbidden) errors under certain conditions. However, with the following setup: Options ...
0
votes
2answers
894 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 ...
0
votes
1answer
53 views

Apache url canonicalization with mod_jk

I have the domain domain.gr. I have setup an Apache server with mod_rewrite and mod_jk. <VirtualHost *:80> ServerName domain.gr ServerAlias www.domain.gr ServerAdmin ...
2
votes
1answer
341 views

Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change

I have an SSL cert valid for the www. and . subdomains on a domain. That's up and working great. All traffic on http redirects to https, and all bare domain traffic redirects to the www. version. In ...
0
votes
1answer
124 views

mod_rewrite some rewriterules not triggering

I am setting up an htaccess file to use some seo friendly urls instead of pointing directly to php files. I have used this method plenty before but this is my first time doing it on a rackspace server ...
0
votes
1answer
3k views

RewriteCond not matching on my IP when matching on %{REMOTE_ADDR} [duplicate]

I want a mod_rewrite rule not to be executed when traffic is hitting the web-server from internal network. The web server is an apache 2.2 The following RewriteCond is meant to guard the rewrite rule. ...
2
votes
3answers
311 views

Forward Apache 500 status to 404

Short version: We'd like Apache to catch when a 500 status is given and return something like 404 instead. Is there a way to do this? Longer version: These servers are running applications that ...
0
votes
0answers
206 views

Is there a way to get a password from HTTP authorization header in mod_rewrite (apache2)

I'd like to parse HTTP authorization header in mod_rewrite - to be able to use login and password for another redirect. I want to achieve something like this: user puts ...
1
vote
0answers
33 views

Mod rewrite to remove a directory

I'm running a PHP web app that has a .htaccess file as below. DirectoryIndex index.php <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase / RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ ...
1
vote
0answers
160 views

mod_rewrite after a cname

I have the domain foo.bar.example.com. foo is one of many sub-subdomains under bar.example.com. I need to capture and redirect all links at foo.bar.example.com that begin with "/special/". ...
0
votes
1answer
85 views

Apache rewrite rule (mod_proxy or mod_rewrite)

I need to rewrite a incoming request for a particular file. The file will have a suffix of .rtfx and I need to remove the host (http://www.host.com/) and replace it with another. Request *.rtfx file ...
0
votes
1answer
90 views

Why does this RewriteRule in httpd not work?

I tried to set this RewriteCond in httpd 2.4.4: ... RewriteCond expr "%{QUERY_STRING} =~ /welcome/" RewriteRule ^(.*)$ %1\.html So, if I visit https://localhost/?welcome , for example, I should see ...
0
votes
1answer
407 views

URL rewriting and SSL conflict

I am facing following problem. URL rewriting with .htaccess is working perfectly on HTTP URLs. Now I have installed SSL Certificates on my server and now accessing my site with HTTPS URLs. Site is ...