-2
votes
1answer
13 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
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 ...
0
votes
0answers
50 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
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 ...
1
vote
0answers
59 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
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
42 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
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
1answer
41 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 ...
0
votes
0answers
15 views

htaccess negation rule not being followed

I'm working on a wordpress blog. The .htaccess file for it includes this block: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond ...
0
votes
0answers
52 views

Changing the current URL but serving content from another (same domain) - ProxyPass?

I've been banging my head against the wall with this for months now so I hope someone on here will be able to finally advise what is needed for this. I have some URL's like this:- ...
0
votes
0answers
62 views

Rewrite rule Mod_Proxy truncate file name

I search online for the solution, but nothing :(. I write this simple rule RewriteRule ^(.*)$ http://www.mysite.com/$1 [P,NE,QSA,L] In mysite.it i have an .htaccess with this rule and it's ok, but ...
0
votes
1answer
52 views

VirtualHost Redirect should work with new RewriteBase

Inside the VirtualHost I got this redirect: RewriteBase / RewriteCond %{REQUEST_URI} wp-content/uploads/([^.]+\.(jpe?g|gif|bmp|png))$ RewriteRule (.*) http://example.org/$1 [R=301,L,NC] So the full ...
0
votes
1answer
126 views

htaccess redirect HTTP & HTTPS non-www to HTTPS www

How can I redirect my website from all HTTP requests to HTTPS + non-www HTTPS to HTTPS with www.? Example: Redirect HTTP non-www, HTTP www. & HTTPS non-www: HTTP:// example.com/ && ...
0
votes
1answer
40 views

How to change image folders and domain with mod_rewrite?

I have images like this - http://www.site1.com/upload/long/long/long/long-path/image.jpg I need redirect all images in folder upload to another site and strip path. Example ...
-1
votes
1answer
44 views

Mod rewrite htaccess worked on old server, not on new server

I have the following .htaccess file, which worked fine on my old host. I moved over to an AWS instance (Ubuntu 12.04 LTS), and it's no longer completely working: <IfModule mod_rewrite.c> ...
1
vote
1answer
63 views

apache change proxy request url rewrite

I have problem with proxy requests. I need to enable apache mod_proxy for my subdomains but i forgot to set Allow from mydomain.com, it was Allow from all...Yes, i created open proxy for all world... ...
-1
votes
1answer
37 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 ...
1
vote
0answers
18 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
votes
1answer
67 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
votes
1answer
69 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/ -> ...
0
votes
1answer
98 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
58 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/ ...
0
votes
0answers
94 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
110 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
27 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
2answers
70 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
30 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
4answers
143 views

HTTPS / HTTP mod_rewrite rules, strange interaction with subsequent CMS index.php rewrite

With the below rewrites in htaccess, as expected, this HTTPS request is not rewritten: https://example.com/system/anything is not re-written to http://example.com/system/anything But, ...
1
vote
2answers
160 views

Apache2 mod_rewrite failing for non-existent sub directories [duplicate]

An even shorter version of my .htaccess file (Last RewriteCond wasn't there) use to work perfectly on my shared web hosting but I've moved to a VPS with Ubuntu 12 with it's stock Apache2 but it simply ...
1
vote
2answers
328 views

Amazon EC2 .htaccess and 500 Error

I have an Amazon EC2 (amzn-ami-pv-2013.09.0.x86_64-ebs (ami-149f7863)) on which I installed Apache, PHP and MySQL. All works fine until I try to activate .htaccess. I change AllOverride All in ...
0
votes
1answer
58 views

Need Corrected htaccess File

I'm attempting to use a wordpress plugin called WP Fast Cache which creates static html files from all your posts, pages and categories. It creates the following directory structure inside ...
1
vote
2answers
197 views

Virtual Host Configuration and mod_rewrite - Removing PHP Extension and Adding Forward Slash

On my production server, things are fine: PHP extension removal and trailing slash rules are in place in my .htaccess file. But locally, this isn't working (well, partially, anyway). I'm running ...
5
votes
1answer
101 views

How to minimise effect of mischievous, persistent POST requests

For a few months now one of our shared hosting servers has been persistently and constantly hammered by "POST /" requests from what must be hundreds of thousands of individual IPs. On a number of ...
-4
votes
1answer
129 views

How to change .htaccess file to work right in localhost? [closed]

I have this snippet code in my .htaccess file to prevent users from hotlinking the server's images: RewriteEngine On RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} ...
0
votes
1answer
63 views

Apache .htaccess rewrite php to js and execute js file as php script

I have the folowing rewrite rule in my .htaccess file RewriteRule ^js_([A-Za-z0-9\.\_\-]{1,50})\.php$ libjs/misc/$1.js so js_messages.php url links to libjs/misc/messages.js file It's working ...
0
votes
1answer
106 views

htaccess rewrite condition old site to new site with querystring

I am not even going to pretend to fully understand how htaccess rewrite conditions work. I've been working on this for a while searching and searching. I have an old Wordpress site www.old-site.com ...
0
votes
0answers
275 views

Rewrite URL and keep POST data

We recently setup SVN for our web development. We'd like to be able to browse different branches/tags/trunk based on the URL you input on our dev server. So, for example, ...
0
votes
1answer
106 views

Server remembering old rewrite rules, even when I remove htaccess

I have set up a development server with Ubuntu and LAMP, but for some reason the .htaccess is acting strange... There is a site on there with a set of rules, when I comment them out they still work, ...
0
votes
1answer
92 views

Trouble configuring virtual host to allow standard wordpress mod_rewrite for permalinks

I'm having a little trouble getting the standard mod_rewrite that wordpress generates in my directorys .htaccess file to work correctly. The server I'm using has a virtual host set up on it by ...
1
vote
2answers
708 views

Request exceeded the limit of 10 internal redirects

so here is the error [Mon Sep 30 00:09:53 2013] [error] [client 66.249.66.205] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' ...
0
votes
3answers
139 views

Mod Rewrite appends Document root in rewrite rules

Previously my host provider gave an option of setting up rewrite rules in apache configuration files. At that time below rule worked fine. # Non WWW URLs to WWW URLs RewriteCond %{HTTP_HOST} ...
-1
votes
1answer
40 views

Apache Hotlink Prevention not Working

I have been trying to prevent hotlinking of images on a domain of mine without any success. I have added the following to /etc/apache2/httpd.conf RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ ...
0
votes
0answers
27 views

htaccess go up a folder, above web root

I've been looking around on the internet, but i couldn't find a good answer to this question. Since i'm very new to htaccess, i would like to know how you would solve this problem. On my site, a user ...
1
vote
1answer
137 views

htaccess RewriteRule force end of execution Apache 2.2

Hi I have written some rewrites, but from what I can tell from the logs it seems that the rules keep executing and so, although the correct result is achieved mid-execution, the final rewrite is ...
0
votes
1answer
602 views

RewriteBase rule works in .htacess, but not in httpd.conf (inside <Directory …>)?

Let me explain by example... File: /var/www/example.com/public/wp-content/cache/minify/.htaccess <IfModule mod_rewrite.c> # THIS WORKS... RewriteBase /wp-content/cache/minify/ ...
0
votes
1answer
57 views

htaccess rules unexpectedly forcing download of gzipped index.html [duplicate]

I'm trying to set up SSL on a Wordpress site. The SSL certificate does not cover both www. and non-www. versions of the URL, so I'm trying to simply redirect everything to https://domain.tld with ...
-3
votes
2answers
147 views

Mod Rewrite code with out changing the url in address bar

I When I call http://www.mysite.in/abc/xyz it shoud show up http://www.mysite.in/abc/xyz/index.php but the url shout not change in address bar and it should work with out "/" in the address. Please ...
-1
votes
2answers
76 views

Website link with out “/” [duplicate]

My Apache 2.2 is running on port "8080" I want to call my site url http://www.example.in:8080/abc/xyz.html/index.php (xyz.html is a folder) as .... http://www.example.in:8080/abc/xyz.html Can ...