.htaccess

Apache/PHP is determined to serve the wrong file

I have a page that is called with a url like http://testserver/path/to/foo/bar/ but apache is serving the wrong file altogether. /path/to/ is a real directory where all the code and .htaccess file is. foo/bar/ is supposed to redirect to foo_bar.php with a RewriteRule, but it never gets there. It's not a mod_rewrite issue as I have comme...

non www .htaccess redirect - ignore other subdomains.

Hi, I have a .htaccess redirect for "non www" like this: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] it is working. But, i have also some subdomains other than www. If I call for example http://shop.example.com it redirects me to: http://www.shop.example.com I dont want t...

301 redirect with htaccess & textpattern

Trying to set up a 301 redirect for a change in domain. I'm using Textpattern which already has a mod rewrite. When adding the redirect I'm prompted with a error page on the site, stating that the page has resulted in too many redirects! This is the htaccess file in use... <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /relativ...

htaccess problem

RewriteEngine On RewriteBase /home RewriteRule ^()$ index.php [NC,L] Rewritecond %{REQUEST_URI} !(^/?.*\..*$) [NC] RewriteRule (.*)$ $1.php [NC] I get a css problem (blank) when I visit http://dot.com/home/index.php/ ...

301 Redirect & site alias

so I have a site I want to take offline. developmentsite.com and I want to redirect to a new site. So I do a 301 redirect. Redirect 301 / http://www.newssite.con. Now I want to continue working on developmentsite.com so I set it up as an alias on my own site mysite.developmentsite.com but because the .htaccess in the main httpdocs fol...

Exclude a URL from rewrite in .htaccess with "last" flag

WordPress has been installed as a blog into osCommerce. I'm trying to get the WordPress RSS feed to work. All WP core files exist, but I get all kinds of errors accessing the feed at mydomain.com/wordpress/feed/, like 404s, "the feed can't be updated because the source file is no longer available," or even raw php code in the browser fro...

Need to use httpd.conf instead of .htaccess for rewrite.

I am working on a host that blocks my .htaccess file from being used so I can not change my permalinks using it. I need to figure out what code to use and where to put it in my httpd.conf file to get the same effect. The code in the .htaccess file is below: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteCond %...

.htaccess : Forward any link to /index.htm

Hey all, I'd like to do the following: If a user gets to a url or types it in, and it is along the lines of any the following: /path/path/path /path /path/path/ I would like htaccess to forward them to that url + /index.htm before triggering a 404. Also, I would like to ignore this rule for certain paths. Here is what I was trying ...

Rewrite rules for subfolders

This may seem like a silly question but I can't figure it out. let's say I have a public_html folder with various folders like: Albatross, Blackbirds, Crows and Faqs. I want to make it so that any traffic to Albatross/faqs.php, Blackbirds/faqs.php, Crows/faqs.php etc will see the file that is at faqs/faqs.php?bird=albatross or faqs/faq...

Avoid Guests accessing files without .htaccess.

We have some applications up and running. We have implemented an Access Control List (ACL) in order to control, which users can do what (guests included). And here is the trouble: Whenever we disallow a guest to see something, the usual procedure for our software is to set a .htaccess and copy users/passwords from the ACL to the .htacce...

Difference between mod_deflate and zlib output_compression

Can anyone tell me the difference between using mod_deflate and zlib output_compression? I understand that zlib is done in PHP and mod_deflate is done in Apace, my .htaccess file looks like: php_flag zlib.output_compression On or: SetOutputFilter DEFLATE BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-...

How do I use .htaccess RewriteRule to change underscores to dashes

I'm working on a site, and its CMS used to save new page urls using the underscore character as a word seperator. Despite the fact that Google now treats underscore as a word seperator, the SEO powers that be are demanding the site use dashes instead. This is very easy to do within the CMS, and I can of course change all existing URLs...

Tricking the server to load files faster?

If we have a website with multiple images and videos, I've read that it's best to serve them from other domains so that the browser can simultaneously download a bunch of files, rather than waiting one by one for each file to be downloaded. For example, if we have a website http://example.com/, we might consider serving: Videos from htt...

.htaccess redirect / rewrite

Hello, I am trying to redirect from: domain.com/uploads/$ to domain.com/download.php?file=$ $ being the variable. I have tried many different ways but do not seem to be redirecting, I've tried, R=301,L,QSA and in various different orders. Anyone help? Thanks! ...

.htaccess help to RewriteRule

Hello all I have a problem, suprice ;) i use .htaccess in Apache and have a RewriteRule problem my code is RewriteRule ^(.*)$ /system/header_codes.php?oldurl=$1 how can i make if its not have a true ( rewriterule ) soe use this, i will use its becures i create a dyanmic RewriteRule for my customer in my System. i hobe for h...

Codeigniter 404 can't find index.php (only on real server, not on virtual server)

Hey, I got a working webpage with CodeIgniter. I did now just upload it to my webserver and it gives me a 404 error. The browser address is "web-page.com/folder/en/about" The baseurl in the config is "web-page/folder/" Also this is in the config.php, I did try AUTO but it does not work either. $config['index_page'] = ""; $config['ur...

Shared hosting redirect question

I have a a few domains on a hosting provider, with DNS/domain name provided elsewhere. To set up the hosting, I set up an A-record for my domain name, with an IP address; that's all normal, of course. All the domains have the same IP address. I don't know if that's normal or not, but it seems like it probably is, at least for cheap hos...

modRewrite htaccess simple rewrite help...

I always need to open index.php but with different url. Because than I'll get url with php and break it... So I need this to work on: http://www.example.com/example http://www.example.com/simple-example http://www.example.com/simple-example/example http://www.example.com/simple-example/simple-example http://www.example.com/simple-exampl...

larger file upload problem with php

I need to upload a csv file to a server. works fine for smaller files but when the file is 3-6 meg its not working. $allowedExtensions = array("csv"); foreach ($_FILES as $file) { if ($file['tmp_name'] > '') { if (!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)) { ...

htaccess, directory listing, and ip addresses

Is there a way with htaccess to allow a directory listing of a folder only for a specific ip address and deny directory listing access to everyone else? ...