Tagged Questions

URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
8 views

Apache2 retrieve files from another folder when not found

While working on an application rewrite, I'd like to keep the old app webroot files as a fallback, when the new files are not found. There are 2 applications: <VirtualHost *:80> ServerName ...
-6
votes
0answers
26 views

Convert Nginx rewrite to htaccess

Nginx rewrite: if (-d $request_filename) { rewrite ^/?$ /get_doc.php last; break; } if (!-e $request_filename) { rewrite ^/?admin /get_admin.php last; rewrite ^(.*)$ ...
0
votes
1answer
34 views

Force SSL for every URL except one path using .htaccess

I'm trying to enforce SSL for every URL except one with the first segment /preview. http://test.example.com/preview/blah/blah should be ignored by the rule; every other URL should be forced to use ...
0
votes
0answers
10 views

Rewrite old mediawiki URL pattern to short URL format and rewrite old URLs to support new format [duplicate]

We have been running a mediawiki installation for some years now. During an upgrade to a newer version, we decided to switch to the short url pattern wikipedia uses. This is working fine. So our ...
0
votes
0answers
6 views

wrong REQUEST_FILENAME if subfolder has the same name as the host

I got the following problem: I have a local wamp server with a virtualhost called admino. The needed vhost-info for that host is: <VirtualHost *:80> ServerAdmin arne@gmail.com DocumentRoot ...
-1
votes
0answers
11 views

htaccess redirect a path to external website only if the website match a value

I have a website reachable by example.com. Now, I'd like redirecting all the pages example.com/admin/ to the homepage (example.com), but the rule should not be applied if I reach the website via IP ...
0
votes
0answers
16 views

Apache rewrite isn't redirecting on ec2

I'm using Elastic Beanstalk with Amazon. I'm trying to setup Apache virtual host on the ec2 instance. No matter what I try, it doesn't seem to work. I'm using the following examples. ...
0
votes
1answer
27 views

Joomla URL Rewriting works automatically in Nginx

This is driving me nuts and I dont understand how this works automatically. I have nginx as my web server and I have installed Joomla that has URL Rewriting which removes the index.php from the URL. ...
0
votes
0answers
17 views

Apache Alias and Mod_Rewrite For WordPress?

I have a site that is running WordPress, anothersite.com, and I am trying to access that site through a different domain, mydomain.com. The goal is to have mydomain.com/anothersite act just like it ...
0
votes
1answer
18 views

Include more than one file in negative RewriteCond

I'm using this rule to ignore index.php in rewritte rule: RewriteRule ^((?!index\.php)[^/]+)/?$ galeria.php?nome=$1 [L,QSA,NC] But I need to include bio.php and contact.php in this rule. How can I ...
0
votes
2answers
27 views

Apache Alias to link to another DocumentRoot

I have a WordPress installed in /var/www/wordpress/ and my own code in /var/www/project/ Now comes the following problem: When I try to access example.com/client/ or example.com/admin/ it should link ...
0
votes
0answers
12 views

Converting .htaccess to lighttpd rewrite rules for Chevereto

I am trying to translate Apache2 htaccess rules to lighttpd rewrite rules. My lighttpd version is 1.4.33. Chevereto uses the G\ php microframework. Apache2 htaccess rule i am trying to convert: ...
0
votes
1answer
27 views

How to redirect from ?page_id=… (apache)?

I have website at Wordpress. And it is webpage in Wordpress www.my-domain/?page_id=111 Now I need to create page outside of Wordpress (at the same server) and direct traffic to it instead of ...
1
vote
1answer
44 views

Apache mod_rewrite - redirect all traffic to another domain, except in 5 folders

We are gradually moving a clients site to a new system & domain name. In the meantime we need both sites live - but sharing bits of the same domain. I have now pointed the primary domain to the ...
-1
votes
0answers
22 views

Mod Rewrite - translate querystring to actual html structure

Old PHP website using /?page=services or /?page=services&section=contact as its url structure. We have created a static file version of the site until we move to something like wordpress so the ...
0
votes
1answer
14 views

GIF loses mime type with Apache rewrite

Got problem with a gif that loses it's animation with the rewrites I'm doing. RewriteRule ^journal/(.+)\.(jpeg|jpg|png|mp4|webm|ogv)$ app/uploads/journal/$1 [QSA,L] RewriteRule ^journal/(.+)\.(gif)$ ...
0
votes
1answer
15 views

Route request to Tomcat only if file doesn't exist on disk

I have Apache in front of my Tomcat installation as a reverse proxy. Most URLs are routed to Tomcat by a JkMount directive in Apache. For one URL pattern I'd like Apache to route requests to the ...
1
vote
1answer
20 views

How can I deny access to a folder in OpenLiteSpeed similarly to the way Apache does it?

I'm trying to deny access to a folder for a website that is hosted with OpenLiteSpeed v1.4.2, but I'm have trouble. I take it that .htaccess isn't supported in OpenLiteSpeed so I am unable to just put ...
0
votes
1answer
50 views

apache rewrite rules for multimple domains | https://www

I have two applications configured on one apache (eg. example.com and test.net). Rewrite rules for those apps are the same (so in config file for domain example.com I've got this rules, and the same ...
0
votes
0answers
121 views

mod_proxy_fcgi and php-fpm with apache 2.4 mod_rewrite vs proxypass, neither solution perfect

If I use mod_rewrite with the P flag most things work right: <Directory /home/dir/public_html/www.site.com> AllowOverride All Options FollowSymLinks Require all granted ...
0
votes
0answers
36 views

Apache + WebDAV: Redirect user to an individual subdirectory (with the use of WebDAV clients)

I'm trying to set up WebDAV and would like to provide a private "Home Directory" for each user. When a user connects to the WebDAV server, he should be automatically redirected to his home directory ...
-1
votes
1answer
73 views

“Simple” .htaccess rewrite for sites in subfolders not working [duplicate]

I have a catch-all Apache virtual host in /var/www/. In it, I have a index.php that handles all the code for pages, and subfolders holding the resources for each site (images, css, etc). I want a ...
0
votes
0answers
25 views

Apache configuration redirect using only redirect, not rewrite

PS: this is the 2nd part of the question originally posted here. I'd like to disable the HSTS header completely for specific virtual hosts. I have (per recommendation) a redirect in the 443 container ...
0
votes
0answers
46 views

Apache mod_proxy cuts off URLs at spaces

I have the following proxy rule on www.example.com/.htaccess RewriteEngine On RewriteRule ^(.*)$ http://www2.example.com/$1 [P] Requests for ...
0
votes
1answer
26 views

Apache Redirect for Internal Traffic Only

We have a page, gateway.school.edu, where users have to fill out a recaptcha before being directed forward to our password reset. I would like any internal traffic, any user agent on our network with ...
-2
votes
1answer
34 views

apache redirect problems with secure connection [closed]

in my default-ssl.conf: <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin my.name@someplace.cool ServerName the-checkout-tech.com:443 ErrorDocument 404 ...
0
votes
1answer
61 views

htaccess conditional redirect to https

So i'm trying to redirect to https all visitors except my internal networks 192.168.x and 10.x RewriteCond %{HTTPS} off RewriteCond %{REMOTE_ADDR} !=(192\.168\.$|10\.$) RewriteRule (.*) ...
0
votes
0answers
30 views

How to set up an Apache ssl proxy for multiple sites using mod_rewrite or proxypass

(I asked this at stack overflow but no one even commented ;( perhaps it's better suited here I hope?) Some background: I wish to access some https sites on a separate VLAN to what my laptop is via a ...
0
votes
0answers
82 views

Apache Directory index doesn't work but index.html yes

2 hours, 2 hours struggling with that. www.domain.com/index.html works, but www.domain.com show indexes, if i click on the index.html, nothing happens. This is the virtuahost. NameVirtualHost *:80 ...
0
votes
0answers
27 views

Move query string to path in proxy - Apache

I am setting up Apache to proxy files from Amazon S3. The initial urls have query strings, but query strings can't be passed to S3, so they are stored as paths with question marks in them (which then ...
0
votes
0answers
94 views

302 redirect on all pages of website, creating crawler issues

My website is having difficulties working with Facebook/LinkedIn/social crawlers. I think this may be due to the redirect headers it seems to be returning. Browsers can access the site completely ...
2
votes
3answers
109 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
72 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
17 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
132 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.: ...
2
votes
1answer
164 views

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
6 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
1answer
60 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
41 views

Allow access to a folder except specific files and folders using a RewriteRule exception in Apache2

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 as well. The problem is that I need multiple exceptions. I ...
0
votes
2answers
52 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
25 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 ...
1
vote
1answer
36 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
65 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
25 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
57 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
77 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
35 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
122 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
371 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
54 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 ...