.htaccess

Help with mod_rewrite and mod_redirect

My .htaccess file is: Redirect 301 http://domain.com/news/articles?dtMain_start=150 http://domain.com/news/articles Redirect 301 http://domain.com/news/articles?dtMain_start=160 http://domain.com/news/articles Redirect 301 http://domain.com/news/articles?dtMain_start=170 http://domain.com/news/articles # RewriteEngine...

Remove trailing slash with mod_rewrite

I've tried every single example I could find, they all produce an internal server error. I have these rules set up (this works, no error): Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f RewriteRule ^((/?[^/]+)+)/?$ ?q=$1 [L] So if it's not an existing file or ...

Rewriting rules with .htaccess

Let's say I have two php files in my root directory (acceable from the internet): index.php and some.php. When someone goes to my site at mydomain.net I want them to be actually accessing some.php and any further path presented in the url would be sent to some.php as a GET value. How would I do this with .htaccess? mydomain.net -> some....

How to hide index.php from Url by htaccess

With respect to Code Igniter And MySql: How to hide index.php from Url by htaccess? ...

Avoiding CGI timeout

I have a function, that gets a large XML file, then parses it, and then uses the details, to get some more xml files, that are again parsed ( A webshop). The problem is, that the processing takes about 15-20mins, but the script timeout's before that, and sends me a 500 error message. Is there a way around this? I read on a post here...

Apache mod_rewrite usually works, but won't work in this folder -- what's wrong?

I have an Apache web server that usually handles mod_rewrite fine. I have a directory called /communications/q/ and I want to rewrite any URI to insert "index.php" before the rest of the entered URI. For example, /communications/q/something/else should actually serve communications/q/index.php/something/else. It's the standard PHP CodeI...

mod_rewrite to 302 a blank query string

I'm currently working with: RewriteEngine On RewriteBase /somepath RewriteRule ^/$ home [R] I'd like to have requests of GET /somepath to redirect via 302 to /somepath/home. What am I missing here? ...

How to do a htaccess modrewrite for redirecting a url ?

Hello folks, Got an urgent issue, and I'm totally stumped. We recently migrated a bunch of networked blogs, and realized one of them was using a subfolder structure, whereas all the new system is all subdomains. The wordpress multisite system doesn't allow for both subdomains and subfolder structures, so I'm guessing the logical soluti...

.htaccess won't work on linux server 1 but does on server 2?

Hey, I have made a .htaccess that I've used on all hosts up until this one to rewrite index.html to the root domain. This is the code Options +FollowSymLinks RewriteCond %{THE_REQUEST} ^.*/index.html RewriteRule ^(.*)index.html$ http://www.domain.co.uk/ $1 [R=301,L] RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ ...

.htaccess - redirect requests from a certain IP only

I believe someone is scraping images from my site. So what I want to do is, based on their specific IP address, serve up some kind of holding image instead of the actual image. How do I achieve this using .htaccess? ...

How to setup optional parameters in mod_rewrite

Hi all, I am in a new project and I'm designing the URL structure, the thing is I want URLs look like this: /category-23/keyword/5/ Where the normal page is: /search.php?q=keyword&cat=23&page=5 So my question is, cat and page fields, must be optional, I mean if I go to /keyword it should be /search.php?q=keyword (page 1) and if I go t...

How to organize your site, so that .htaccess works

I am building a Dynamic web site from scratch for the first time so I am new at this. I need to match this URL: www.domain.org/world/2.html with this: www.domain.org/index.php?html=world&rss=2 For that purpose I am using this rewrite rule: RewriteRule ^([^/])/([^/]).html$ /index.php?html=$1&rss=$2 [L] And this should be working, bu...

this is url rewrite is not working

i tried to create this url rule buts not working: i dont know why :( orginal url www.example.com/viewprofile.php?username=jhon the desired friendly url is www.example.com/user/jhon this is my.htaccess code: RewriteEngine On RewriteRule ^username/([^/]*)$ /viewprofile.php?username=$1 [L] thanks for helping!! :)) ...

url rewrite deosnt access my css and images? why

i have this rewrite rule for my urls, it deosnt seem to acess the css and images, why? :)) orginal url its working: http://www.example.co.uk/viewprofile.php?user=muna rewrited url, this deosnt work: http://www.example.co.uk/user/muna htaccess code: RewriteEngine On RewriteRule ^user/([^/]*)$ /viewprofile.php?user=$1 [L] my css ...

httaccess rewrite is using only 2 files php

How htaccess syntax? I have 3 files (php) a. premium.php b. direktori2.php c. direktori_det2.php this Flow: example.com/AbelPutra-com (inside premium.php) and i direct to direktori2.php file ---> RewriteRule ^([A-Za-z0-9-()/&]+)/?$ direktori2.php?NamaToko=$1 [NC,L] this is OK example.com/AbelPutra-com/Modern-Karaoke (inside dir...

Apache mod_rewrite rewrite everything but files in .htaccess?

The following RewriteRule redirects every request to bootstrap.php except the filextenstions between the parentheses RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css|pdf|doc|txt|htm|html|xml|ttf|flv|swf|xml|ics|htc)$ bootstrap.php Is it possible to exclude ALL files witouth declaring them like above? So all requests should...

Change wordpress permalink structure for pages

okay, I have 3 sections to a site /section-1/ /section-2/ /section-3/ I don't want their child pages to have a reference to them in their permalinks /section-1/apple/ /section-1/orange/ /section-1/banana/ The second level pages in each section will never have the same slug or title. I want the second level pages to look like th...

Converting Standard Request Uri Into Clean URL using .htaccess

I have a URL with the following format: http://domain.com/checkout/nonce/701fe0f652/order/108/?token=EC-0DS37792JX3680821 I try to convert it into a clean URL using .htaccess: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\?token=(.*)$ /index.php/$1/token/$2/ [R...

How can I block Alexa Toolbar users?

Any ideas how I can block Alexa Toolbar users? I don't want to appear in the rankings while we are in beta ... I see you can block their search engine with User-agent: ia_archiver Disallow: / but I can't find any documentation on how to pull your self from actually being ranked.. I read earlier someone tried to email them and they r...

.htaccess AddType plain/text

I have a page that I dynamically show my Unix scripts in another folder. I added: AddType text/plain .sh <-- this is the only thing in .htaccess in the "unix" directory So I could see the codes, but SOME files are still offered as a download while others go to the correct plain text display. Here's the site live: http://snyfarvu.far...