.htaccess

[mod_rewrite] redirect ex-ample.com/asdf to example.com/asdf

Hi, I want to redirect all requests from ex-ample.com to example.com. The url structure should remain the same, I only want to "replace" the "-" in domain... http://www.ex-ample.com/asdf123 redirects to: http://www.example.com/asdf123 thanks! ...

.htaccess profile rewrite help

RewriteRule ^user/(.*)/(.*) profile.php?user=$1&v=$2 [L] works for http://10.0.1.5/user/Kevin/wall/ if i do http://10.0.1.5/user/Kevin/wall it 404's. if i do http://10.0.1.5/user/Kevin/ it 404's if i do http://10.0.1.5/user/Kevin it 404's I tired RewriteRule ^user/(.*) profile.php?user=$1 [L] RewriteRule ^user/(.*) profile.php?u...

Htaccess non-www and strip index.php in a nice way

I'm having some trouble with my .htaccess redirections. I want a situation in which the (non-www)domain.tld is redirected to the www.domain.tld. And I want to rewrite the arguments to skip the index.php, making a request for /foo go to index.php/foo. Initial situation First I had these rules RewriteCond %{HTTP_HOST} ^domain\.tld [NC]...

HTTP authenticate a directory via an existing users table in a database.

I wish to tie my user accounts into HTTP for a specific directory of my website and normally that wouldn't be too much of a problem, because I could either edit the htpasswd file or use mod_auth_mysql (which I'm not too familiar with). However, the passwords are encrypted using SHA1 and a salt. How can I HTTP authentication password an...

is this htacces or something else

Hello, I have uploaded codeigniter site here. http://www.fitlifeacademy.com/gpahesapla/ It runs fine at local server but after uploading i get this error. “404 Page Not Found The page you requested was not found.” Also, http://www.fitlifeacademy.com/gpahesapla/index.php/functions/calculator Also “No input file specified. ” upload...

htaccess rewrite breaks relative paths

Hi, I have an htaccess file which maps http://www.myserver.com/home/ to http://www.myserver.com/index.php?section=home This part works fine. The issue I am facing now is, all my images and css reside in a sub-folder named assets, i.e. http://www.myserver.com/assets/images/ http://www.myserver.com/assets/css/ etc. After redirection the...

How can I get a user's input when using htaccess/htpasswd?

Hi, I want to create a log in system using htaccess and htpasswd file and PHP for the server-side code, but when the user logs in I want to be able to identify that user, so how can I know what the user typed in as their username using PHP code (I assume I won't need to know the password if they've managed to access the restricted page)?...

Force trailing slash

I'm trying to force a trailing slash to my URLs, but I can't make it work the way I want. This is my .htaccess file: RewriteEngine on #Force trailing slash RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !index.php RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ /$1/ [L,R=301] #Subdomains RewriteCond %{HTTP_HOST}...

One subdomain without cookies

Greetings I have a website with multiple subdomains, one subdomain per language: pl.example.com, en.example.cm, fr.example.com. I would like to keep one session across all subdomains so I'm setting session cookie and remember_me cookie for ".example.com". On the other hand all images should be served without cookies. Is it possible to t...

Removing .php extention with .htaccess not working

What is wrong with this script? The server returns a 404 error whenever I type in a url without an extention. RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [NC] Does anybody have a better way of doing it? ...

htaccess help, removing a string from the URL

Hi there, I am wondering, is it possible to remove index.php from an URL? Basically on some pages in a site I have this structure, http://www.domain.com/index.php/members/register, but other pages I have URL structures like this, http://www.domain.com/category/products/id/5, I want to know is it possible with htaccess to remove the in...

How can i write a .htaccess for only 1 module in a Zend Framework project

Hey all. I have a zend framework project with 2 modules - admin and default. the admin is for managing my stuff and the default should be used only for my clients. that's why i wanted to limit the default module only to the allowed domains. i searched in google and found that i can can limit the .htaccess by that code: http://www.eukhos...

Pass variables from htaccess to bash script

Hi, I'm trying to pass the value of a cookie to a bash script: RewriteCond %{HTTP_COOKIE} mycookie=(.*) [NC] RewriteRule .* script.sh?cookievar=%1 ... but can't seem to find out how to read the GET variable in the bash script. (I suppose I'm asking Google the wrong queries, but can't find any info on this). Is this even possible, an...

HT Access IP restriction and htpasswd

Is there a way to require the use of htpasswd if the user is not in a certain IP range? EDIT: K I have this right now Order Deny,Allow Deny from all AuthName "Htacess" AuthUserFile /var/www/Test/.htpasswd AuthType Basic Require valid-user Allow from 111.111.111.111 Satisfy Any But its giving me a 500 error ...

Removing .php extention with .htaccess problem

Possible Duplicate: Removing .php extention with .htaccess not working What is wrong with this script? The server returns a 404 on whenever a link without a .php extention is clicked/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [NC] My problem is that i've been remov...

.htaccess break all css and js, though i set absolute path

Here is my .htaccess file Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !=cms RewriteRule ^([^/]*)/search/([^/]+)$ index.php?lang=$1&id=search&searchword=$2 [L] RewriteRule ^([^/]*)/([^/]*)$ index.php?lang=$1&id=$2 [L] It doesn't work as i expect. ...

Learning .htaccess

I would like learn about .htaccess file, from the very basic to the complex portions. All its capacities, with blocking user, authentication, hiding files, redirection. So far I have only used them, but I want to learn about them, understand them. So that I will be able to create my own rule. Could you please guide me through this, and ...

mod_rewrite - failing on HTTP host condition

Hi All, I'm trying to do some URL rewriting - but for some reason it's not working as I expected (I've probably missed something really simple!). I have two sites - www.domain.local and admin.domain.local. Using the below .htaccess file, the public site rewriting is fine, but the admin site isn't working as expected, as it is being pic...

hard problem with .htaccess

i want RewriteRule to make this from file.php?var_1=xx&var_2=xx to file/var_1?var_2=xxx ...

Remove top level parent from permalink structure on Wordpress 3.0.1

I'm working with wordpress permalinks at the moment. The site has 3 hidden areas, managed simply by a top level page. As this page is simply structural, I don't want it to appear in the permalink: -Section 1 -- Page 1 -- Page 2 - Section 2 -- Page 1 -- Page 2 - Section 3 -- Page 1 -- Page 2 instead of /section-1/page-1 etc I'd like /pa...