URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
382 views

Apache 2.4/PHP-FPM ProxyPassMatch and access restriction

I've got Apache/PHP setup exactly like this: https://wiki.apache.org/httpd/PHP-FPM It includes the ProxyPassMatch rule as mentioned: ProxyPassMatch ^/(.*\.php)$ ...
0
votes
0answers
57 views

Custome page when Apache Server is down

I've looked at Apache ErrorDocument directive on how to do this. I found an answer here and it mentioned : You should use a URL to point to your ErrorDocument otherwise if you use a filesystem ...
0
votes
2answers
145 views

FreeBSD Apache 2.4 rewrite/proxy module errors

Just set up a FreeBSD jail to run httpd in it and all works good except these two, rewrite/proxy modules. These are error logs excerpts: mod_rewrite error: [rewrite:crit] [pid 43447] ...
0
votes
1answer
27 views

Possible to map a directory to another server (for independant Wordpress install)?

We have EC2 instances that I would like to not contain a wordpress install, and instead ideally map a folder to a different server, and run it under the same domain. For some reason, this is ...
1
vote
1answer
105 views

Apache: Add a prefix to all URLs in a virtualhost

In one of my machines I have an internal server which listens at port 8090. I am using a virtualhost in Apache to proxy the internal server using a URL like servera.mydomain.com: <VirtualHost ...
0
votes
0answers
103 views

Apache Alias on multiple vhosts + redirect rules

I'm facing a tricky problem and I have problems to solve it through Apache config. I have two vHosts on my machine: A) /var/www/front/web app.domain.ext B) /var/www/api/web api.domain.ext This ...
1
vote
1answer
178 views

mod_rewrite exact hostname match with multiple conditions

I have a set of requirements for mod_rewrite that is breaking my head. Any hints / pointers would be appreciated: domains: www.domain-europe.com www.domain.com requests for www.domain-europe.com ...
0
votes
1answer
142 views

Apache rewrite to remove “www” not working (globally)

I've taken the Apache Server Configs global .htaccess file and placed it on my web server, as /etc/apache2/apache-server-configs.conf. Then in my /etc/apache2/apache2.conf file I've got this towards ...
0
votes
0answers
50 views

Can you do a masked URL rewrite to a different protocol (in Apache)

Apache 2.2.15; I want to do: RewriteCond %{HTTP_HOST} site1.com RewriteRule (.*) https://site2.com [R=301,P,L] But that does not work. I put the P in there thinking it might allow the mod_proxy ...
0
votes
0answers
81 views

Proxy to SSL site (on another server) from a non SSL site

I have a *:80 virtual host in Apache 2.2.15 which is just a bunch of URL rewrites like: ServerAlias foo.bar biz.baz tit.tat RewriteRule / http://somesite.com (R=301,L) ServerAlias ...
1
vote
0answers
405 views

nginx rewrite for php restful api apache htaccess

I have an apache htaccess file used with Restful API tutorial <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ...
0
votes
1answer
19 views

Does RewriteEngine On enable for all subsequent vhosts

If I have in my conf.d Apache directory 001_vhost.conf 002_vhost.conf ... etc, does Putting RewriteEngine On in 004_vhost.conf enable the Rewrite Engine for 005 006 007 008 etc vhosts, but not those ...
0
votes
1answer
55 views

can htaccess file define different RewriteBase for production and dev servers

I have htaccess files that use different RewriteBase on production and dev (windows) pc. Currently I change the RewriteBase manually when deploying. Can this be done automatically with some ...
0
votes
1answer
22 views

Setting up additional breadcrumb re-direct using mod_rewrite

Currently I have mod_rewrite configured as follows: <VirtualHost *:80> ServerName address.website.org ServerAdmin webmaster@website.org DocumentRoot /var/www Redirect permanent / ...
1
vote
1answer
122 views

Why can't I redirect url's with “index.html” in it to a php file?

I'm stuck in a big problem, but let me start with one part of it. I am wodering why this works: RewriteRule ^(.*)index.html $1 [R=301,L] while this doesn't: RewriteCond %{REQUEST_FILENAME} ...
0
votes
1answer
144 views

apache2 redirecting https to http

[tl;dr] Why is apache redirecting https that has gone through rewrite engine to http I have a site that is redirecting some pages (only ones that have been through rewrites) from https to http. ...
0
votes
0answers
40 views

Remove Port Access Using mod_rewrite or Something Else

Server Info: Apache VPS, WHM/cPanel, CentOS I am using a CDN/reverse proxy (Cloudflare) to obscure the true IP of my server. So I intend to access WHM/cPanel using the direct IP like this: ...
0
votes
2answers
716 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 ...
2
votes
0answers
462 views

Apache 2.4 + mod_rewrite + FastCGI (php-cgi.exe) on Windows

I am trying to port my Mac config on Windows for some of my clients. Since Windows is not Mac OS, I have to use php-cgi.exe instead of PHP-FPM. I have tested each component individually and ...
-1
votes
1answer
188 views

Mod_Rewrite Laravel Folder

Ok I'm pulling my hair out, can't get the mod_rewrite rules to work. This is my apache config <VirtualHost x.x.x.x:80> DocumentRoot "/web/domain1/" ServerName www.example.com ServerAlias ...
0
votes
1answer
85 views

redirect string to different url in nginx

I want to redirect a string to different URL in nginx. This what my vhost looks like and is working fine. server { listen 80; server_name secure.example.com; root /opt/tomcat/webapps/test/; ...
0
votes
1answer
158 views

apache - query string rewrite rule adds percentage symbol

I've set up a rule to rewrite a query string. Although the redirection is correctly performed, a % character is appended to the rewritten query portion of the URL, like so: ...
0
votes
1answer
214 views

Apache rewrite using THE_REQUEST for rewriting GET requests only

Background: In order to reduce repo size of git repos containing wordpress installs, we are removing static assets from the repo. The bulk of the work is done, but I have a snag. I've relocated the ...
0
votes
1answer
78 views

Configuring subdirectory with apache2 and HTTPS

I have a domain my.domain.com that points to a Zend Framework 2 application at /path/to/project/public which has a .htaccess and index.php file which handles all requests. At ...
0
votes
1answer
90 views

How can I rewrite from /page to /xx/page, using htaccess & apache only?

Hi I have found many resources on mod-rewrite and Apache but I haven't been successful of making a working example. The example below works for ✓ WORKS example.com/en/page1.php ☞ ...
0
votes
1answer
43 views

mod_alias.c rule to redirect all subdirectories

A mod_alias newbie here. I found the rewrite rule below somewhere and have been using it to block bots and hackers that hit my site, looking for directories like HNAP1, wp, blog, etc. And it works ...
0
votes
1answer
63 views

Apache Redirect rule with same url

I am trying to write a RewriteCond and RewriteRule to the following. If someone tries to access forex.com or forexample.com they should both redirect to forexample.com/abcd/xyz/. The below rewrite ...
0
votes
1answer
42 views

Redirect Alternative Domain Names for a Web Site While Maintaining Request Integrity

We bought some domain names that are similar to the primary domain name for our Web Site. All of these alternative domain names are associated with a single VirtualHost of which I can edit the single ...
0
votes
0answers
27 views

Handling spaces in SCRIPT_FILENAME with mod_rewrite

I'm having trouble using a reverse proxy when my URL has a space in the script name. For example: http://test.com/exam/good%20job.html?success=1 Gets rewritten and sent to: ...
0
votes
1answer
211 views

Pretty permalinks not working Apache, Wordpress, Mod rewrite

I'm trying to change the permalinks in Wordpress, so the URL uses the post-names instead. I've tried to modify the httpd.conf directly as below but Apache doesn't seem to be parsing the URL. I keep ...
1
vote
1answer
37 views

ModRewrite combine sites to one

Hi I am having some issues configuring rewrites which have fairly complex requirements browsing (www.)A.com should => www.B.com browsing (www.)A.com/{anything}/blah/foo/yes should => ...
2
votes
5answers
335 views

Rewrite Rule: appending a path to URL

Update Thanks for all the replies so far. I'd like to make clear that the number after user (e.g. user1) in my example is not significant. The user can be any alphanumeric name. I want to make ...
1
vote
2answers
57 views

mod_rewrite mysteriously appends subfolder to rewritten url

EDIT: [Solved] Finally found the solution in the documentation; posted an answer. In short: the DPI flag. EDIT: at the bottom, added an easy way to reproduce the problem online. I've spent a few ...
1
vote
2answers
135 views

Apache mod_rewrite: domain -> www.domain with wildcard SSL

I have an Apache 2.2 server and a wildcard SSL certificate for *.domain.com and have set up a mod_rewrite ruleset for both 80 and 443 that will properly redirect requests for domain.com to ...
0
votes
0answers
72 views

Rewrite/configure WebSVN location with MultiViews

I have configured mod_dav_svn 1.8.9 on FreeBSD along with WebSVN 2.3.3 this way: <Location /repos/svn> DAV svn SVNParentPath /usr/local/svn/repos SVNListParentPath On ...
0
votes
0answers
144 views

DirectoryIndex not working properly for rewritten URL

I have domain.com and sub.domain.com pointing to the same server and I'm using mod_rewrite to rewrite URLs for sub.domain.com to the sub subdirectory. I have the following .htaccess file in the ...
0
votes
2answers
44 views

Mod Rewrite based on HTTP_HOST don't change browser address

I am not exactly clear on why this isn't working properly. I have sub.domain.com with its contents in /sub_folder, and sub.domain.com is listed in the ServerAlias directive for domain.com. The DNS ...
3
votes
2answers
377 views

Mass virtual hosting with Apache 2.4

I would like to use the value set by VirtualDocumentRoot in a RewriteRule. The Apache documentation says: The other thing to determine is the document root (configured with DocumentRoot and ...
0
votes
1answer
87 views

htaccess rule for url not ending with certain words

I need to rewrite few urls if those url not ending with certain words. For example, i need to rewrite following url /category1/subcategory1/aproduct-url-title to ...
0
votes
0answers
12 views

How to get log of the addres that mod_rewrite is redirecting to?

I have defined a rewrite rule that is creating an 404. But I can't find any additional information about where the Apache is really looking for the file so it can't find it and also I don't see ...
0
votes
1answer
28 views

mod_rewrite Unmatch of .php and Also Slash

I'm trying to write a set of rewrite rules that will send all requests for static assets to our CDN while keeping requests for PHP files local to the server. I have one rule that works for "match ...
0
votes
1answer
81 views

Redirect domain/directory to domain2/directory

I would like domain1.com/customers to go to domain2 my home directory public html's folder / customers. Both domains are on different servers. In the folder on the second server/second domain we will ...
0
votes
0answers
166 views

Apache rewriting sub domain URL with www prefix

My website is rewriting all subdomain links with www. for example news.example.com works fine, but if I go to news.example.com/wp-admin it will rewrite the URL to www.example.com/wp-admin ...
0
votes
2answers
82 views

Subdomain-to-folder redirect (HTTPS)

I have the following in my httpd.conf at the very bottom. No other configuration is done. NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@contoso.com ServerName ...
1
vote
2answers
124 views

Lighttpd rewrite subdomains to subfolders

I have a server (itself on a subdomain) with wildcard DNS pointing to it. The server is running Lighttpd and PHP. I need requests to http://any-subdomain.server.example.com to rewrite to ...
0
votes
1answer
47 views

Masking external domain with Apache2 [closed]

Let say, that you own domain www.example.com and have another project on another domain on server that you do not have control: www.sub.notmine.example.org. And you want an user do navigate to ...
0
votes
1answer
83 views

rewrite rule does not rewrite url as expected

I have a problem with a CMS website, that normally generates readable urls. Sometimes it happens that navigation links are shown as www.domain.com/22, which results in an error, instead of ...
-2
votes
1answer
106 views

How to redirect using Apache [closed]

I am working on moving an IIS server website onto an AWS Load balancer. I am trying to figure out how to Manipulate a web link in Apache. My team and I are currently using IIRF to redirect the link in ...
0
votes
2answers
383 views

A RewriteRule for all VirtualHosts on Ubuntu 14.04?

After a2enmod rewrite, I wrote the file /etc/apache2/conf-available/myspecific_rewrite.conf : RewriteEngine on RewriteRule ^/test(/.*)?$ http://anothersite.tld/test$1 [R] RewriteRule ^/test2(/.*)?$ ...
1
vote
2answers
651 views

Apache httpd mod_rewrite with Tomcat resulting in lost JSESSIONID

So I'm working on a Java web application, for which I recently implemented an authentication module that relies on the JSESSIONID cookie to identify users. I was testing on a local tomcat from eclipse ...