Questions tagged [mod-rewrite]

mod_rewrite is an Apache module that allows for server-side manipulation of requested URLs.

Filter by
Sorted by
Tagged with
0 votes
1 answer
481 views

how can i tell if original requests are secure or unsecured using lighttpd infront of play framework?

My system is running the play framework through lighttpd. I need to know if the requests that are coming from Facebook are from https or http. Two questions: Is there any way that I can tell in my ...
nightograph's user avatar
0 votes
1 answer
668 views

How do you redirect requests to a different host?

Basically I want to create a situation where files served from my /cdn directory to use my cdn host rather than the local host. How can I do this with apache rewrite? I tried this but it doesnt ...
qodeninja's user avatar
  • 2,783
0 votes
1 answer
792 views

mod_rewrite redirect loop when forcing the www. on a domain

I'm trying to force the www. on only the production server. I do not want to affect the staging server's domain. Here is my current rule: # Force www RewriteCond %{HTTP_HOST} !^www.mydomain.com$ #...
Jesse Bunch's user avatar
0 votes
1 answer
800 views

WordPress pretty permalinks not working

I can't get WordPress pretty permalinks to work on my Fedora LAMP server. If I set them and click a page/post link I'll get a ""Oops! This link appears to be broken." The .htaccess file is writable ...
Yarin's user avatar
  • 1,366
0 votes
1 answer
291 views

dynamic DNS wildcard

You can set the DNS record like mod_rewrite in Apache? Where? anything.myapp.com > redirect to > myapp.appspot.com/anything dynamically, hundreds of thousands of accounts... Or do I ...
user avatar
0 votes
1 answer
952 views

nginx redirect to a subdomain even without trailing slashes

I just installed and partially configured nginx on a dedicated server of mine. But I've got some trouble understanding the regexp. I would like to make nginx redirect www.mydomain.com/forum/ AND www....
Oliver A.'s user avatar
0 votes
1 answer
774 views

Apache "connection reset" only after setting RewriteLogLevel to >0 on Win7

I was working with mod_rewrite on my work computer, which runs apache 2.2 on XP. More pertinently, I was using RewriteLogLevel 9 for debugging. No problems. I went home to do more work with apache 2....
Fred Wilson's user avatar
0 votes
2 answers
298 views

Returning a 404 page when a folder is accessed from one domain, but allowing access from other domains and IP addresses

Situation: I want to return a 404 page ("404.php") when a folder ("hidden") is accessed from the example.com domain. I want the same folder to be accessible from a subdomain ("hidden.example.com") or ...
okw's user avatar
  • 103
0 votes
1 answer
288 views

htaccess unhungry regex causing 500 error

On my local WAMP server the following lines in .htaccess cause no problems, and do what I want: RewriteEngine On Options FollowSymLinks RewriteRule ^foo/([0-9]+)/[a-z0-9-]*?$ foo.php?id=$1 [L] When ...
beldaz's user avatar
  • 243
0 votes
1 answer
71 views

Mod_rewrite question - what does this code for files do?

I was researching .htaccess on here, and decided to try this code I'd found: RewriteRule ^([^\.]+)$ $1 [T=application/x-httpd-php-source] What does this do exactly? I know it's a rewrite rule, but ...
whitstone86's user avatar
0 votes
1 answer
356 views

Apache rewrite to ignore certain directory and all its contents

I'm looking for the rewrite rule for mod_rewrite in Apache so that when asking for a specific subdirectory, it and all its contents gets redirected to another location. I currently have the following:...
Javier Novoa C.'s user avatar
0 votes
1 answer
216 views

Apache ReWrite all traffic to new base

I would like to use Apache rewrite to do a 301 redirect for all traffic to the new base url. I don't want the path to be the same, I want every request to be redirected to just "http://sub.mynewdomain....
markus's user avatar
  • 612
0 votes
1 answer
71 views

mod_rewrite and Apache questions

We have an interesting situation in relation to some help desk software that we are trying to setup. This is a web based software application that allows customers and staff to log into it and access ...
John's user avatar
  • 2,276
0 votes
3 answers
4k views

Looking for equivalent of ProxyPassReverseMatch in Apache to fix missing trailing forward slash issue

I have two web servers, www.example.com and www.userdir.com. I'm trying to make www.example.com as the front end proxy server to serve requests like in the format of http://www.example.com/~username ...
Alex Man's user avatar
0 votes
1 answer
56 views

Apache redirects directories

So, I'm trying to redirect any pages to a file, but avoid redirecting anything thats an existing file or directory. RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d RewriteRule ^(.+...
borntyping's user avatar
0 votes
1 answer
498 views

How do you redirect from one directory to another and maintain the proper basepath?

I need to redirect all /eula traffic to /tos RewriteRule ^/eula/$ /tos [R=301,NC] but this rule doesnt seem to work -- mostly because the basepath is being treated as the root when really theres ...
qodeninja's user avatar
  • 2,783
0 votes
2 answers
485 views

How can I rewrite the root location of resources referenced in reverse proxy pages in Apache 2?

We have an application server located at http://foo.bar . It needs to be accessed via http:// wibble/foo using reverse proxying. This I've managed, however there is stuff in http:// foo.bar which ...
Squeeb's user avatar
  • 172
0 votes
1 answer
219 views

url rewrite to make generated thumnails cache like static, a syntax question

this is a pain in the ass-problem!! Given: most proxies, do not cache resources with a "?" in their URL even if a Cache-control: public header is present in the response. To enable proxy caching for ...
Sam's user avatar
  • 423
0 votes
1 answer
111 views

Using Mod_rewrite to rewrite all requests with subdomains, what am I doing wrong?

I am trying to make it so that all requests that use a subdomain are rewritten in such a way that they are sent to the server as "regular" request without the subdomain. I have created the mod_rewrite ...
Rick's user avatar
  • 121
0 votes
1 answer
5k views

Multiple levels of .htaccess files with RewriteRule, only deepest level processed

I have .htaccess files at multiple levels of a directory heirarchy, each with RewriteRules in them. However, when arequest is made for a file in a subdirectory, only the rules in the most deeply ...
user avatar
0 votes
2 answers
2k views

How to rewrite query strings in url (\img?src=foo.jpg) into cachable urls (\img-foo.jpg)?

a question that is now partially resolved. A genius who can speak Apache fluently can shine light into this matter... GIVEN: Most proxies, do not cache resources with a "?" in their URL even if a ...
Sam's user avatar
  • 423
0 votes
1 answer
1k views

Apache 310 redirect with wildcard URL

I'm trying to redirect this... http://www.wfmc.org/administrator/components/com_civicrm/civicrm/extern/url.php?u=878&qid=3686395 -- Where '&qid=3686395' varies from link to link. How can I ...
j Reid's user avatar
  • 1
0 votes
1 answer
738 views

mod_rewrite rewrite broken URL and bad query string

I'm having trouble with mod_rewrite. There's a broken external link to my site that looks something like this: http://www.example.com/foo/page?myparam=AB/some-garbage.asp?bar=123 I'm trying to ...
runrig's user avatar
  • 143
0 votes
2 answers
257 views

mod_rewrite Configuration for All Subdirectories

In Apache HTTPD 2.2, I want to make it so requests for /index.foo or /foo, if they aren't files or directories, become /index.php?transform=foo, regardless of how many levels the URL has. Criteria ...
Hugh Guiney's user avatar
0 votes
1 answer
273 views

URLs with final slash trigger hotlink protection on my server

in all my Apache servers I use hotlink protection because I hate the idea someone could stick my images/flash in their sites using my server bandwidth. In order to make hotlink protection work, in my ...
Marco Demaio's user avatar
0 votes
2 answers
200 views

Problem with .htaccess doesnt see rewrite rules

I setup a virtual host and put in htaccess some rewrite rules... But they dont work.. Only the rules in virtual host config work.. What am i doing wrong? .htaccess setEnv TZ Europe/Athens Options +...
GorillaApe's user avatar
  • 1,379
0 votes
1 answer
162 views

write rewriterule for just index.php?

How can write rewriterule to redirect just: http://example.com/index.php to https://example.com/index.php And anything else stays the same ex: http://example.com/index.php?a=2&lang=English ...
jalal allam's user avatar
0 votes
1 answer
122 views

.htaccess redirect doens't work correctly

I'm using a .htaccess to get all documents from an old site to the new one. The old site doesn't support PHP or mod_rewrite. I tried the following code: Redirect 301 / http://www.new.com/archive/ I ...
Simon's user avatar
  • 101
0 votes
3 answers
950 views

Apache URL rewrite for subdomain pointing to an existing virtual server resource?

I'm trying to point subdomain.example.com to a resource on subdomain2.example.com/?page_id=1 It's a wordpress blog. I'm attempting to give a static page its own subdomain. The point is to basically ...
user avatar
0 votes
1 answer
235 views

I want to redirect http://www.mydomain.com/subfolder/index.php to http://mydomain.com/subforlder/index.php , How can I do this?

I want to redirect http://www.mydomain.com/subfolder/index.php to the very same url without the WWW prefix, how can I achieve this? Thanks
user57256's user avatar
0 votes
2 answers
2k views

Using apache rewrite modules without .htaccess file

I have just completed this tutorial (and afew others) on how to use mod_rewrite with apache: http://www.workingwith.me.uk/articles/scripting/mod_rewrite . However, they all focus on using the ....
JB87's user avatar
  • 23
0 votes
1 answer
1k views

mod_rewrite: redirect from subdomain to main domain

I have two domains - domain.com and forum.domain.com that points to the same directory. I'd like redirect all request from forum.domain.com to domain.com (for example: forum.domain.com/foo to domain....
Bald's user avatar
  • 113
0 votes
2 answers
2k views

How to serve dynamic pages outside the document root?

I'm trying to setup a simple web app and I'm having some difficulties. Here's how I have it setup : /srv/www/application <-- python code /srv/www/public_html <-- document root I want Apache ...
subb's user avatar
  • 103
0 votes
1 answer
72 views

setting up mod-rewrite to handle queries with and without data

I have the following modrewrite rule: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^blog/([^/]*)/([^/]*)/$ /blog.php?date=$1&title=$2 [L] Which is pretty straightforward. My question is, how ...
Chris Sobolewski's user avatar
0 votes
1 answer
101 views

Apache Mod Rewrite

We are using Apache 1.3.19 and have started our first foray into mod-rewrite. We would like to convert a URL structured like so: http://somesite.com/us/en/bc/somePage.jsp to: http://somesite.com/...
user56331's user avatar
0 votes
1 answer
74 views

Mod Rewrite - Check for a file in a particular directory

I'm using the following mod rewrite script, I want to change it to try looking for a file in a particular directory, can somebody give me a hint on how to achieve this please? <IfModule ...
dallasclark's user avatar
0 votes
2 answers
746 views

Broken .htaccess

I'm losing my mind here. I had a .htaccess for a website with the following content: Options FollowSymLinks <ifmodule mod_rewrite.c> RewriteEngine on rewritecond %{http_host} ^XXX.com.ar [nc] ...
santiago.basulto's user avatar
0 votes
1 answer
289 views

Hide .php add a slash

This script works perfect it forces the trailing slash and hides the .php extension BUT! it does not redirect people going directly to the .php extension. How can I also force people going directly ...
user avatar
0 votes
1 answer
311 views

How to strip www for all hosts in apache?

I read SO topics on the matter. However, they only apply to single hosts. I would like to have a uniform rule for all the server for current and future domains. Basically, I want to remove www from ...
user avatar
0 votes
3 answers
280 views

Lightttpd Rewrite

How can I rewrite www.domain.de/news/news_944836.html to www.domain.de/news_944836.html in Lighttpd? All my Trys didn´t work :(
user avatar
0 votes
1 answer
899 views

Resolve local subdomain on apache for paths within user dir

On Apache 2.2.x I've activated mod_userdir. I used the default setup, so that http://localhost/~name/ will be connect with ~name/public_html/ and a path within public_html, e.g. ~name/public_html/...
MaoPU's user avatar
  • 246
0 votes
1 answer
123 views

Error 403 when accessing an address to rewrite

I have the following rewrite rules: RewriteRule ^products/([a-zA-Z]+)$ /project/clients/index.php?database=$1&module=products [L,QSA] The directory structure is as follows: /var/www/project/...
andres descalzo's user avatar
0 votes
1 answer
349 views

Need to have the home page redirect to a different document root with apache

I want to have anything other than www.example.com and example.com directed to a different root directory. so example.com and example.com/page will be going to two seperate roots. i need to do ...
user52177's user avatar
  • 101
0 votes
1 answer
186 views

mod_rewrite, execute rules if substring found

Here is an example of old url: index.php/component/option,com_fireboard/Itemid,180/catid,15/func,view/id,4272/#4339 And now url is like index.php/component/option,com_kunena/Itemid,180/catid,15/...
Clark's user avatar
  • 337
0 votes
1 answer
2k views

how to replace &,?,.,= to another string and redirect this to file?

What do I have to do to replace & = [and] ? = [vop] . = [too] = = [rav] from URI using mod_rewrite? For example I need to redirect: "http://www.domain.com/?boo=1" to "http://www.domain.com/[...
Clark's user avatar
  • 337
0 votes
1 answer
2k views

RedirectPermanent vs RewriteRule [R]

I currently have a perm_redirects.conf file that gets included into my apache config stack where I have lines in the format RedirectPermanent /old/url/path /new/url/path It looks like I'm required ...
notbrain's user avatar
  • 219
0 votes
1 answer
381 views

Multi Svn Repositories in Apache

I have a set up with apache and subversion In the apache configuration i have <Location /svn> DAV svn SVNParentPath c:/svn </Location> Now i have multiple repositories a a_b a_c ...
Filipe Pinheiro's user avatar
0 votes
1 answer
1k views

htaccess - Redirect from domain.com/index.php to domain.com?

is it possible to do a rewrite rule in a htaccess that redirects from www.example.com/index.php, to www.example.com? Thanks!
Probocop's user avatar
  • 279
0 votes
3 answers
344 views

Apache re-write from URL to Internal URL?

I have Outlook Web Access hosted on IIS Windows Server 2003 and the setup is weird from some other dude. I have Apache listening on 8080 I want users to be able to type in something like: mail....
user avatar
0 votes
1 answer
91 views

Apache: Configuration for main site and subdomains

I want to setup an specific environment for my hostings, but don't know what's the best approach. I want have a domain called example.com. * The www. should contain the main website (hosting site) * ...
user avatar

1
32 33
34
35 36
45