I am struggling to get this .htaccess file to work with lighttpd, i am not a coder so its very hard for me to fix it, hopefully if someone knows how can tell me how to write rewrite code that will get it working. {quote}
1. Comment the 2 lines below if the server returns 500 errors! Options -Indexes Options +FollowSymLinks
#Uncomment following lines if you want to use image caching! #<IfModule mod_expires.c>
1. Uncomment following lines if Apache doesnt support MultiViews! <IfModule mod_rewrite.c> RewriteEngine On 1. Uncomment the 2 lines below if you are using www.domain.com # as the baseurl for the site and users access your site # via domain.com (THIS IS REQUIRED FOR JQUERY TO WORK) #RewriteCond %{HTTP_HOST} ^domain.com [NC] #RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
1. Edit below lines and set to 2. ErrorDocument CODE /RELATIVE/error.php 3. If the script is installed in the default document 4. root then relative is null. #ErrorDocument 401 /error.php #ErrorDocument 403 /error.php #ErrorDocument 404 /error.php {/quote}
looks like its calling the rule from loader.php file, now how can i convert this to lighttpd language,
I've just moved a few webistes from Linux to Windows and I'm using IIS to run them. Does anybody know of any free alternatives to ISAPI_REWRITE so I can use mod_rewrite per account?
Its October and I have a Server at home with me running NO CONTROL PANEL... I have been using it for 5 years now... But my problem is my mod_rewrite is not working... I have tried fixing it... But I can't find it in the httpd.conf file where I heard it was at... They said it came by default by Apache..
I'm running Apache2.2.4, Fedora Core 7), PHP 5, MySQL 5.... I don't see the mod_rewrite on there....
I have a list of categories that i want to rewrite the URL to display the names instead.
I'm using this: RewriteMap catlist txt:C:/web/apache2/htdocs/catnames.txt RewriteRule ^/cats/(.*)$ /categories.php?catid=${catlist:$1|0}
catnames.txt consists of CategoryName 6 AnotherCatName 8 OnemoreCatName 9 ..... and so on.
This works fine on my local windows PC since i'm using httpd.conf to set this up. When i use this on my server under .htaccess, the error log says "RewriteMap" not allowed here. I it only to find out that i cant use RewriteMap under .htaccess... Is there any other alternative to achieve this without listing all the category names with corresponding rewriteurl statements in my .htaccess file?
I have installed a Apache server version 1.3.33 on windows XP and would like to enable mod_rewrite so i can rewrite my ugly url´s. How do I install this great feature in Apache so i can test it locally?
[warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored. [warn] RewriteCond: NoCase option for non-regex pattern '-d' is not supported and will be ignored.
actually found in new vb discussion of seo friendly urls and mod rewrite was an option for most friendly url, so wanted to know if constant usage of mod-rewrite adds additional load to the server or not?
forum which I and my friends use are pretty big more than 6k in a forum and other above 25k, with 250k posts in 1 forum and 600k posts in the other, so just give me an idea on wat can happen due to constant overwritten?
So I've setup a server heres the spec provided by Webmin
Operating systemUbuntu Linux 8.10
Webmin version1.470
Time on systemSun Mar 29 18:56:12 2009
Kernel and CPULinux 2.6.27-11-server on i686
System uptime5 days, 19 hours, 42 minutes
I'm struggling with mod_rewrite their seems to be no such thing...
Its not mentioned in the apache2.conf or httpd.conf, httpd.conf was blank previously but I added in certain things to get php working but I cannot get mod_rewrite working, which brings the question forward what else am i missing?
I started out with the aim of blocking the ability of viewing directories.
I have been using apache and php-cgi and it works well together but when I tried to use mod_rewrite it stopped working and I got "Internal Server Error" result.
Apache error log showed "FastCGI: incomplete headers (0 bytes) received from server"
I think that mod_rewrite rules are ok because when I refer to some HTML file then it all works.
But the subdomains also seem to be loading rather slow. Am I doing anything wrong here? Is there any way to optimise or simplify this (I have around 11 subdomains on the old domain)?
I am attempting to redirect any subdomain as follows:
subdomain(dot)domain(dot)com to domain(dot)com/index.php?user=subdomain
I am having some issues doing this though. None of the samples online seem to work. Do I need a wildcard subdomain? Do I need to do anything to the dedicated linux server I am on? I have other sites on the same server all using mod_rewrite successfully.
RewriteRule ^(.+)/(.+)/?$ $1.php?args=$2 [QSA,L] RewriteRule ^(.+)$ $1.php [QSA,L,NC] My very framework relies on the .htaccess working this way... I can turn it off, however I would really rather not - so if you have any idea how I can fix this, please do tell.
And on a related note, is it possible to run PHP under a user and not use cgi_php?
I've got a big .htaccess file which works brilliantly in mod_rewrite for apache. However, the client I want to use it for uses a windows server which is based on IIS.
Does anyone have experience with rewriting urls on IIS. Is it easy, could I easily change this:
Hey guys... Not sure if this was posted yet, couldn't find anything on a first-glance search.
Netfirms has finally added mod_rewrite capabilities as well as better .htacces support! Now I'm completely happy. I was considering switching over to Dreamhost due to the fact that I've started running blog software and messy URLs = crap. Now there's no need. That was pretty much the only thing that was holding me back from a full endorsement, so if anyone's looking for a good cheap hosting plan, here's some of the stuff that I'm really happy about for $5 a month:
- quick, personal customer service (I think there's only 1 or 2 guys, and they always seem to be able to answer my questions on the spot)
- mod_rewrite - .htaccess - reliable clean FTP (no _vti files or other annoying folders like so many companies these days) - good online knowledgebase - nice online site stats viewer - a bunch of other great stuff that I probably have forgotten about or don't use - only $5!
Just thought I'd share in case the news hadn't spread yet. Not sure when they added it, but I noticed the "NEW" sticker today.
I'm moving a framework over to a new server for a client and they're using IIS. Is there an IIS equivalent to the following two lines of mod_rewrite code from Apache?
i have a bunch of rewrite rules that work fine on my dev server but when i upload to production server they dont work. is a restart of apache required?
im on a dedicated box so this shouldnt be a problem, but how do people on shared accounts do this then?
I tried searching the forums a bit and the Apache manual, but I was unable to find much related to my specific problem.
We have a system such that each user has a 'www' folder in their home directory so that example.com/~user will point to that folder. The user information, however, is not on the www server and instead we use a network file system to access the files in the home folder.
This all works fine and dandy with mod_rewrite. However, we want to allow each user to have access to the error logs, etc. for their own site. The best way to do this seems to simply store it in their home directory.
The problem is that how do you split these files apart. While it would be possible to have a separate process do it, the best way seems to just have each user be their own vhost. mod_vhost_alias seems to be applicable in this situation.
However, mod_vhost_alias relies on either the Host: field or the ip to split queries into their respective vhosts. As said before, our system uses the directory.
So the question is, is there a way to either use mod_rewrite to tell mod_vhost_alias what the vhost's name is. Or, is there a way to split the logs another way.
Code: [error] [client XX.xxx.XXX.x] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. Now Earlier I had that ip keep accessing my server for an odd reason. So I used mod_rewrite to block its requests.
Code: RewriteRule file /index.php [R=301,NC] RewriteRule file2 /index.php [R=301,NC] RewriteRule file3 /index.php [R=301,NC] So I am convinced Errors I am getting with these are from bots that are not accepting the redirects?
So - I'm trying to do the following: Have multiples domains on multiple servers, with a single server handling them all. I need mod_rewrite to map: [url] -> [url]
But do it silently - so a [301] Redirect or similar won't do - www.olddomain.com is still the domain I want everyone to use *always*.
I've seen ProxyPass (and mod_proxy) but it appears that these need to be done at an httpd.conf-type level - how can this be achieved with mod_rewrite?
Effectively, I just want *everything* on a particular domain redirected to another domain silently in the background. In actual fact, it'll 99% of the time be on the same server - but I think the principle should be the same anyway.
I am using mod_rewrite to rewrite some URL's for a database application. One of my URL's I am rewriting must start (after the base folder) with a folder named after one of the 50 U.S. states (ie. /alabama/, /alaska/, /arizona/, and so on.).
Is it okay to include all 50 of these state names within my RegEx pattern conditional? Or is that way too much info to put into a pattern and be too intensive?
I got a domain name with 123-reg and hosting at godaddy, set up the dns and got everything working fine.
I created a script in PHP in a .png file with the help of a .htaccess, the script basically outputs an image with the name of the filename. So say if the .png was called image.png which had the code in, I could call image.png and it would output 'image', if I called foo.png it would output 'foo' - with the help of mod_rewrite where i redirected all .png requests to the proper image.png which had the code in.
Phew. Now I uploaded the files to godaddy and the .htaccess and I just cannot get the image to output properly, it works locally but not on the godaddy server, no image is output at all, i think it is a mod_rewrite problem.
Has anyone got any ideas how I could solve this? I'll paste some example code if it will let me to help you get an idea.
I have many directories from years ago on a fileserver. Many of them are indexed on Google. I have five webservers reading from one fileserver for the data. I'd like to keep copies of the most recent data on the webservers and through mod_rewrite tell it to use local copies instead of reading through the fileserver. I would like to move most of my older directories into an "archived" directory.
If I move most of my older directories into an archived directory, the Google listings will then 404. I could put a 404 doc up redirecting to the index page, but Google will drop the link, which I would like to avoid.
I could add a new RewriteCond / RewriteRule (below) for each new directory. But, it would need to be added in the httpd.conf file for each of the webservers and restarted. With the number of new directories I add, this would be infeasible.
Does anyone know of a way to accomplish what I am trying to do? I do not need the older directories in the "archived" directory to be accessible or rewritten, I just don't want to lose the search engine listings from them. And, I want to reduce the strain on the fileserver for these files.
I also don't know of a way to say: rewrite everything locally unless it is in the /dir1/archived directory and if there is a 404, the directory probably existed at some point, redirect that to the index and give a 200 status code.
Does anyone have any suggestions? I tried mod_cache but it doesn't seem all that speedy.
RewriteEngine on RewriteCond %{REQUEST_URI} ^/dir1/dir2 RewriteRule ^/dir1/dir2/(.*)$ /path/to/dir1-localcache/dir2/$1
I'm trying to get a problem with image hotlinking under control. What I'd like is to allow linking to thumbnails but only allow the fullsize images to be served via another page.
What I'd like is to allow all request to /thumbs/(1-99)/*.jpg but redirect all calls to uploads/(1-99)/*.jpg to view_image.php while allowing all calls to any other existing php page on the site.
I thought it would be something like this but I've tried many variation on the standard denying hotlinking .htaccess scripts I've got and they work to a point but I can't seem to combine them to perform the above?
Can someone please put me out of my misery or point me to a good mod_rewrite tutorial!!!
I have tried, without success, to block approximately 50 crawlers of the Baidu search engine, in China; since this web site can only sell magazines to people with U.S. addresses. The top 6 lines of my .htaccess file are at the bottom of this post.
Someone in OLM Support gave me the below link to webmasterworld. Since nothing I have tried so far has worked, I would appreciate someone knowledgeable about mod_rewrite and .htaccess letting me know whether I can place those 3 lines at the very top of my .htaccess file, or, if they need to be placed lower in the file. (If so, where?)
how to keep the Baidu crawlers out. The site is on Shared Hosting, so trying to keep them out with iptables or something else is not an option for me. They do not look at the robots.txt file or sitemap.txt file, they just come in....
[url]
If your site is on an Apache server, you can block using mod_rewrite via .htaccess:
RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^Baiduspider [NC] RewriteRule .* - [F]
I included the [NC] which allows for case differences since at least one of the Baidu bots uses "BaiDuSpider"
deny from baidu.com deny from crawl.baidu.com deny from 220.181.7. deny from 123.125.66. deny from baiduspider-220-181-7-20.crawl.baidu.com deny from baiduspider-220-181-7-61.crawl.baidu.com