URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
91 views

Apache mod_rewrite - why friendly URL doesn't works with static files?

My configuration to use friendly URL works fine when the destination is a php script, like this: RewriteRule ^products/([a-z0-9-]+)/([0-9]+)/?$ /prod.php?id=$2&name=$1 [NC] But, when I use a ...
0
votes
4answers
132 views

Modrewrite phpmyadmin to HTTPS

I'm using this to force access to phpmyadmin onto HTTPS but it's staying on HTTP, other directives in the .htaccess file of the site work fine. RewriteEngine On RewriteCond %{SERVER_PORT} 80 ...
-1
votes
1answer
246 views

mod_rewrite: Redirect https://example.com to https://sub.example.com [duplicate]

I have an domain example.com running on an Apache Server and I want to redirect every call to https://example.com to https://sub.example.com. I have a Virtual Host configured like this: ...
-2
votes
1answer
64 views

Apache mod_rewrite with content moved to different subdomain [duplicate]

I have a url xyz.example.com for which contents were moved to abc.example.com. I know this can be redirected using mod_rewrite and had moved too, but when accessing xyz.example.com, in user's browser ...
0
votes
0answers
74 views

I got “Request exceeded the limit of 10 internal redirects”?

I have a rewrite RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^(.*).club.domain.net$ RewriteRule ^(.*) %{HTTP_HOST}$1 [C] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
-1
votes
1answer
92 views

apache disable unconfigured subdomains [duplicate]

There is a webserver which has example.com, www.example.com, my.example.com, shop.example.com, static.example.com. All sites except www.example.com is on https. My problem is when I type ...
0
votes
0answers
20 views

RewriteBase in httpd.conf + RewriteRule in .htaccess? [duplicate]

RewriteBase is set in httpd.conf for an alias: Alias /test /home/user/test <Directory "/home/user/test"> AllowOverride All Allow from All RewriteEngine On RewriteBase /test ...
1
vote
0answers
102 views

apache mod_rewrite rules for subdomain and restful structure

I'm trying to setup several rewrite rules that allow a restful url structure to exist, but only on a certain subdomain. Several subdomains already point to the shared codebase. I also have an ...
0
votes
0answers
20 views

How should I configure my mod_rewrite rule for use in subdirectory?

I have a simple PHP site that uses the following .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)/? ...
1
vote
2answers
195 views

Server-level block, deny, or redirect based on User-Agent?

We've recently begun having trouble with web-scraper/DDoS service 80legs taking down our servers a couple times per week due to their abusive crawling practices. Initially we were simply dropping in ...
-1
votes
1answer
93 views

Block Wildcard User-agent

how can i write rewrite condition for wildcard user agents here is the code I'm trying but doesnt work RewriteCond %{HTTP_USER_AGENT} !*uTorrent* [NC] RewriteCond %{HTTP_USER_AGENT} ...
1
vote
2answers
139 views

Can Apache be made to not send responses to specific requests?

In an effort to harden a public-facing webserver, my colleague and I came up with a plan that involves getting Apache to "Black-hole" certain requests. For instance, requests for phpmyadmin (which ...
-1
votes
1answer
170 views

Apache htaccess get subdomain and prepend it to path [duplicate]

this is my first question on ServerFault and I think I couldn't find a similar one. To the point. I would like to achieve the following using my .htaccess. subdomaina.example.com/stats/ -> ...
2
votes
1answer
436 views

Disable Apache basic auth in virtual subdirectory

I have a webserver that is completely locked down with Basic Auth <Location /> AuthType Basic # [...] rest of basic auth stuff require valid-user order deny,allow deny from ...
1
vote
1answer
347 views

Weird apache mod_rewrite behavior

I'm new to the site and I hope you can help me with an issue that happened to me trying to install Rhodecode. Here's the (long) story: I've managed to install Rhodecode inside a virtualenv in a linux ...
0
votes
1answer
130 views

Apache2 mod_rewrite redirect all except one folder [duplicate]

I need to redirect the requests for my old website (www.old.com) to the new domain (www.new.com) but I would like to keep the old content available in a different folder (www.old.com/oldsite). I've ...
0
votes
1answer
201 views

Combine chained rewrite rule to remove all trailing slashes

I'm using this rule to remove all trailing slashes: RewriteRule ^(.*)/////////$ $1 [N] RewriteRule ^(.*)////////$ $1 [N] RewriteRule ^(.*)///////$ $1 [N] RewriteRule ^(.*)//////$ $1 [N] RewriteRule ...
0
votes
1answer
174 views

convert lighttpd to nginx rewrite rules

I'm trying hard to make my code work on nginx. This configuration works with lighttpd but I want migrate it to nginx. Rewrite rules on lighttd : url.rewrite-once = ( "^/(ui)/(.*)$" => ...
0
votes
1answer
202 views

Apache Adding DocumentRoot to URL when www not used - could be rewrite issue

When I visit www.mysite.com all is well. When I visit mysite.com (without the www) I get redirected to http://www.mysite.com/home/admin/domains/mysite.com/public_html which gives a 404 error. ...
0
votes
1answer
74 views

Apache rewrite rule adds 2 superflous slashes

I want to redirect all www to non-www with a google friendly 301 in apache2.2 It works basically but when I enter www.test.net in the browser I get redirected to test.net// and I would prefer without ...
0
votes
1answer
513 views

Apache: proxy an internal URL using regex

I have a few servlets listening on internal ports which are not accessible from outside. I use Apache's ProxyPass and ProxyPassReverse directives to serve them securely from port 443: ProxyPass ...
0
votes
1answer
89 views

MOD_REWRITE for rewriting GET requests [duplicate]

I need a .htaccess expression to use the second get variable or get the get variable by name. Currently my mod_rewrite alters the URL to remove index.php filename and alter the pageName GET variable ...
0
votes
0answers
128 views

WORKING URL with capital letters to lowercase rule for mod_rewrite

I tried both (mod_rewrite) rules from http://www.askapache.com/htaccess/rewrite-uppercase-lowercase.html But they ain't working. http://www.example.com/de/Accessoire -> 404, it doesn't rewrite to ...
0
votes
1answer
116 views

301 permanent redirection changing URL structure [duplicate]

I changed category urls on site. Old are like this: www.example-name.com/category-name-exactly-same-keywords/ ...
-2
votes
2answers
35 views

redirection of https page in apache [duplicate]

As it currently works. The endusers have to go the URL: https://cloud.olaf.europe.eu/owno and that works but i want the users just to go to: https://cloud.olaf.europe.eu/ to access the page. I ...
0
votes
0answers
120 views

Mod-Rewrite - going from plain url to one with special characters

I am having a little issue with FreeBSD 10 RELEASE and Mod_Rewrite when it comes to special characters -- not in the source URL, but in the destination URL. The vast majority of Mod_Rewrites that I ...
0
votes
1answer
301 views

404 returned though rewrite rule is matched

I have one rewrite rule that sends all requests to index.php: RewriteRule ^.*$ index.php [NC,L] (Apart from RewriteEngine On, that's all there is in the .htaccess file) It works, unless the ...
0
votes
0answers
35 views

After migrating to Plesk 11 / Apache 2.2.15, some rewrite rules ignored [duplicate]

First, thanks in advance for any insight. We recently migrated to Plesk 11 / Apache 2.2.15. After doing so a number of our rewrite rules no longer work as expected. For example, this no longer ...
0
votes
1answer
66 views

Rewrite rule custom 301 redirection

I have link like this: www.example.com/full-image/folder/subfolder/image-name.jpg-some-custom-keywords.html and I need 301 redirection to url like this: ...
0
votes
1answer
93 views

What can cause “Invalid command '%{HTTP_USER_AGENT}'”

While browsing my site, not even making any modifications to it, the whole thing suddenly 500's on me. Error log is full of this: Invalid command '%{HTTP_USER_AGENT}', perhaps misspelled or defined ...
1
vote
1answer
243 views

Apache Dynamic Virtual Host with SSL [duplicate]

I have the following in my httpd.conf file NameVirtualHost *:80 <IfModule mod_vhost_alias.c> <VirtualHost *:80> ServerAlias * UseCanonicalName Off LogFormat "%V %h %l %u %t ...
0
votes
1answer
540 views

Apache mod_proxy+mod_rewrite = “Request exceeded the limit …” error [duplicate]

Good day, I'm using Apache as a reverse proxy for my Tornado app which runs on http://localhost:8090. I want Apache to proxy everything that arrives to /api/v2 through HTTPS to http://localhost:8090. ...
0
votes
1answer
301 views

Apache Dynamic Virtual Host: RewriteMap: file for map vhost not found

Following the instructions on Apache's site I have added the following to the end of my httpd.conf file: RewriteEngine on RewriteMap lowercase int:tolower #define the map file RewriteMap vhost ...
0
votes
2answers
119 views

getting started with apache mod_rewrite on a virtual host [duplicate]

hey SO I am attempting to use apache's mod_rewrite module to do some basic rewrting of url on my website so they become a little more seo friendly basically I have a virtual host file that look ...
0
votes
1answer
902 views

nginx url rewrite rule

I'm doing a migration from a WordPress blog to a Jekyll Blog using NGINX as my HTTP server and I don't want to break the Internet by leaving some URL's not working as expected. I got to a point where ...
0
votes
0answers
89 views

Dynamic vhosts www alias — symlink vs mod_rewrite

MI have hundreds of domains, each of them added dynamically. Now I want each domain to have www.* alias, as far as I know there are two ways to achieve this: 1) Using symlinks www.domain.com → ...
-1
votes
1answer
44 views

Apache MOD_REWRITE for subdomain

Summary I have 2 servers, 1 Production & 1 Development Problem I want to keep the servers URLS the same in the code. The production server will be blah.com but I want the development server to ...
0
votes
0answers
28 views

mod_rewrite Multilevel directories with pagination [duplicate]

I am trying to build rules for multilevel categories with pagination. Now, if there is no page input, it doesn't work. www.site.com/category/level1 www.site.com/category/level1/page=5 ...
0
votes
1answer
43 views

mod_rewrite map doesn't work

I am trying to build a simple mod_rewrite map to have category names translated into ids like so: ../category/electronics -> category.php?cat=1 The map is placed inside the www folder. The code ...
0
votes
0answers
165 views

Apache error log not showing full path of 404 failures

If I have a working path like /gallery/landscapes and I try to access this inexistent url: /gallery/landscapes/whatever I see the 404 error in my browser but the apache log says that I had an ...
1
vote
1answer
40 views

Can Apache's URL redirection send a request to both original URL and rewritten URL?

I would like to use Apache's URL redirection to match a URL and forward it's request to another URL. Simple enough, I know. But, I'd like the originally requested URL to continue to be called in ...
0
votes
1answer
680 views

Apache/2.4.6 update causes 404s

I'm running a ec2 ubuntu instance, I decided to update my PHP today to 5.5.7, unfortunately it triggered apache to update as well, which has caused me many errors, the biggest one is my rewrite rules ...
0
votes
1answer
46 views

Redirect all pages to one page on same domain

I have this htaccess rule RewriteCond %{REMOTE_ADDR} ^xxx\.xxx\.xxx\.xxx RewriteCond %{REQUEST_URI} !/path/to/file.php$ RewriteRule $ /path/to/file.php [R=302,L] and the purpose to is redirect a ...
0
votes
1answer
52 views

Apache rewrite: Strip out url part [duplicate]

I have a Ruby on Rails app with two sub-sites, www.example.com/site1 and www.example.com/site2. For demonstration purpose, we need to disable site2 and only show site1. So I made some redirects in my ...
0
votes
1answer
69 views

Redirect to default image when file is not found

From an iOS app I upload small avatars of Apple Game Center users to a web server, into an /ios-avatars/ dir. But some players do not have any pictures. By using Apache mod_rewrite is it please ...
0
votes
0answers
238 views

redirection in Apache include current ServerPort

For long time I am using Apache instalation which doing automated redirect with mod_rewrite (mainly root redirected to specific app and from HTTP to HTTPS but also other). There are could be severeal ...
0
votes
1answer
42 views

Rewrite a directory to another directory without a redirect [duplicate]

I have the following rewrite rule: RewriteRule ^support/(.*)$ /blog/support/$1 [R=301,NC,L] However, all it does is a simple redirect. What I want to is for /support to show the contents of ...
1
vote
1answer
35 views

Rewrite rule when source contains a '?' [duplicate]

Scratching my head on this. I have an old URL: http://myserver/blog/archive?openview&type=Category&key=Demo and a new URL http://myserver/blog/categories/Demo I'm trying to get ...
0
votes
0answers
68 views

Making changes in Loglevel httpd.conf of apache server?

I am working on windows-7 Visual studio 2008,According to Apache: Configure "LogLevel debug" for certain modules only? i am making changes in the loglevel of configuration file I am giving ...
1
vote
2answers
72 views

How to use mod_rewrite to abstract get request with subdomains

I've been at this all day and I thought I had a handle on regular expressions but I'm no longer confident that I do. I've searched all over, read through some horrible guides on mod_rewrite and I'm ...