URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
24 views

Apache mod_proxy

Uggh, I'm spewing that I can't figure this out, I'm so frustrated: <VirtualHost *:80> servername domain1.com.au ServerAdmin webmaster@localhost DocumentRoot ...
-2
votes
1answer
11 views

mod_rewrite redirect any domain except principal domain to the principal domain

I have some rules as follows: RewriteCond %{HTTP_HOST} ^domain.com RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L] I would like to make the rewrite condition match ANY domain OTHER than ...
0
votes
2answers
15 views

RewriteRule Works With “Match Everything” Pattern But Not Directory Pattern

I'm trying to redirect newsletter URLs from my local server to an Amazon S3 bucket. So I want to redirect from: https://mysite.com/assets/img/newsletter/Jan12_Newsletter.html to: ...
-1
votes
1answer
19 views

Exclude location from nginx if directive

Currently I use this for redirecting everybody to the SSL page: if ($scheme != "https") { rewrite ^ https://$server_name$request_uri? permanent; } does someone know how to exclude a specific ...
0
votes
1answer
17 views

How do I serve 403 Forbidden from Apache through mod_rewrite? [closed]

I want to serve 403s to some visitors. Currently they are redirected with the following lines: RewriteEngine On RewriteCond %some_condition RewriteRule ^/(.*) http://example.com/ [R,L] What can I ...
1
vote
1answer
15 views

Apache Proxy and Rewrite Rule for Proxy

I set up my Apache server as a proxy for a local server listening on port 8080. It works no matter if I specify a valid proxy or not. Both configurations work. Configuration 1: <Proxy ...
-2
votes
1answer
30 views

Nginx rewrite rule not working

Can someone help me convert this rule? I have over 50 rules, but I can not make this rule work: #APACHE RewriteRule ^([^/]*)/([^/]*)\.html$ /?cmm=$1&page=$2 [L]
1
vote
0answers
40 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
32 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
53 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
0answers
15 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
20 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
40 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
votes
0answers
26 views

apache mod_rewrite seems to work - but doesnt http to http - browser says page not found

I have apache 2.215 and a purchased SSL cert My site has 2 virtual domains The first domain I want to always access through HTTPS (port 443) The second site through HTTP (port 80) The virtual domains ...
1
vote
1answer
30 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
42 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
28 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
33 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 ...
0
votes
0answers
49 views

Showing only domain with .htaccess and mod_rewrite

I currently have koken installed to my website (wythDOTno-ipDOTbiz/koken). I know that the .htaccess file in the koken folder is working, because it is making the url's clean by removing the ...
0
votes
0answers
62 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
14 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
25 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
0answers
58 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
38 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
21 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
72 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 ...
0
votes
0answers
144 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
33 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
50 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
69 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
71 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
32 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
41 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
27 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
0answers
30 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
31 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
17 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
68 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
193 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
38 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
64 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
30 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
32 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
34 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
158 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
39 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
8 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
20 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 ...