URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

2
votes
3answers
27 views

nginx [emerg] unknown “0” variable

I've been trying for two days to convert an .htaccess to nginx rewrite the original file looked like this: # Turn on URL rewriting RewriteEngine On RewriteBase // # Protect hidden files from being ...
0
votes
1answer
11 views

RewriteRule not working properly in my ubuntu server 14.04 running in Windows Azure

In my server I kept signup.php and in htaccess I kept this thing - RewriteRule ^registration/$ signup.php [nc] However it's working fine in my Windows machine running Wamp. But not ...
0
votes
1answer
10 views

Alter RewriteRule to change parameter results

Here is my Apache 2 Directory configuration: <Directory /var/www/html/website/> Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f ...
0
votes
1answer
29 views

Configuring .htaccess on a site with a CodeIgniter app and traq issue tracker

I have this site running on CodeIgniter and I have installed traq for issue tracking. Under public_html I have my application and system directory as well as an assets directory, and also traq. i.e.: ...
-1
votes
0answers
13 views

Receive OK from PHP file before showing the page, using HTACCESS

I'm hosting on my servers few files (like photos) that I don't want to be public. So I build a PHP form that asks for OTP, and if the code is correct, it shows "OK". It's not hard to prehibit the ...
1
vote
1answer
57 views
+50

Apache, htaccess, url rewrite

I have .htaccess file I'm using for testing, here is my file: RewriteEngine On RewriteCond %{REQUEST_URI} ^/([a-z-]+)/?$ [NC] RewriteRule ^ %{REQUEST_SCHEME}://%{SERVER_NAME}/?title=%1 [L] I'm ...
0
votes
0answers
13 views

mod_rewrite - clean url path the same as directory [duplicate]

I have a directory /news within the root directory and I have a /news path within my application. I have some subdirectories and files in the /news directory. How to allow request the subdirectories ...
0
votes
0answers
5 views

mod_rewrite: Use Substitution from Previous Condition

I'm trying to do a basic language redirect based on a cookie. To do that and prevent a loop, I need to check that the user isn't already on the correct URL, so I wrote this rule: RewriteCond ...
0
votes
0answers
14 views

Redirecting URL according exist Files Mod_rewrite and SetEnvIf

First check if a file exist in URL supplied eg: http://IP.Server/TheFolder Now I want to obtain this FirstFile.Ext1 Exist: http://IP.Server/TheFolder/FirstFile.Ext1 else obtain this ...
0
votes
1answer
42 views

Logging 403 Rewrites for Brute Force Attacks

As explained in Wordpress Codec, I want to prevent brute force attacks for wp-login.php via RewritetRule. http://codex.wordpress.org/Brute_Force_Attacks#Deny_Access_to_No_Referrer_Requests Rather ...
-2
votes
1answer
27 views

apache rewriterule exception

I'm having issues redirecting a website at work to a new URL. The redirect of the site works just fine. An exception to the redirect works beautifully as well. The problem is that I need multiple ...
0
votes
2answers
26 views

Rewriting a download URL, but “save -as” dialog shows original URL

I have the following mod_rewrite directive in my lighttpd config file: url.rewrite-once = ( "foo.*$" => "static/foo.pdf", ) I'd like to hand out URLs like this: ...
1
vote
0answers
16 views

Apache Internal RE-WRITE to replace 301 redirect

I need to internally rewrite (due to partial CMS content restructure) as I currently have a permanent 301 redirect and it is killing SEO. I do not want the users browser to redirect or know about the ...
0
votes
1answer
29 views

Apache Rewrite Rules

I have moved my website from a Wiki to Wordpress and in the process, realised that I have broken links to some popular pages on my website. Is it possible to fix this with a rewrite rule? I need the ...
0
votes
1answer
44 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
18 views

mod_rewrite redirect any domain except principal domain to the principal domain [duplicate]

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
20 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
29 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 ...
1
vote
1answer
26 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
47 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
1answer
99 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
36 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
71 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
23 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
35 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
53 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
52 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
51 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
33 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
50 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
73 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
170 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
16 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
36 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
78 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
49 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
29 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
149 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
249 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
56 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
63 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
105 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
102 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
44 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
57 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
31 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
43 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
36 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
19 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: ...