.htaccess

Wordpress Htaccess eliminate _GET parameter

How to add a new rule on Wordpress default .htaccess to eliminate all the _GET parameter? <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> The example is like if I have URL of http://w...

Htaccess RewriteCond for the target file

I have a script that generates images having such urls: /photo/XXXX/W/H where XXXX an id of image, w - width and h - height there is no directories called photo/XXXX on webserver document root. Now I created directory /cphoto and script caches images to that folder. Once script launches it generates static image in folder /cphoto with n...

php and non existing files

on my site i call non existing files and it show index page not error 'not found page'. but i need to get this error, any ideas? update here my htaccess file # BEGIN WPSuperCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / AddDefaultCharset UTF-8 RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} !.*=.* Rewrite...

Friendly url rewriting with php & .htaccess. Difficulties with relative links to css images & js

Hi there, I've currently an url like that : play.php?place=idplace&event=idevent I've enabled friendly url this way : RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ play.php?place=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ /play.php?place=$1 RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /play.php?place=$1&event=$2 RewriteRule ^([a-zA-Z0-9...

Rewrtie - ignore strings in URI

Hi! I have some problem with rewrite rules. Now my config looks like this: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ${REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_URI} ^/video/(.*)$ RewriteRule ^(.*)$ /video/index.php [L] So links example.com/video/?p=2231&c=395840&s=849264&l=101641 works fin...

PHP Redirection (301) hiding query string

Hi there, I'm trying to redirect a page using PHP (I think it has to be PHP as opposed to .htaccess as there are a lot of pages involved and the information required to do the redirect is held in a datbase). The page i'm trying to to a redirect from is already re-written, and looks like: www.example.com/shop/deptartment/section/produc...

.htaccess fix for a pretty permalink in PHP?

Maybe I'm going about this in the wrong way, but I have some pages in our homegrown CMS that I want to convert to using pretty permalinks. Currently, their page URLs look this this: http://ourdomain.com/articles/?permalink=blah-blah-blah I want to convert these to: http://ourdomain.com/articles/blah-blah-blah I have a column in the d...

How to rewrite /foo to index.php?x=foo but also /foo/bar to index.php?x=foo&bar=true in one RewriteRule?

Using Apache's RewriteEngine, how to rewrite /foo to index.php?x=foo but rewrite /foo/bar to index.php?x=foo&bar=true in one RewriteRule? I have this now: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)? index.php?x=$1 [L,NC] # rewrites /foo to index.php?x=foo, but not /foo/bar to index.php?x=f...

Trying to get Product Name and product ID into url with slash at the end and in between without ?p=

Hello, I guess the title almost says it all. My original url looks like: http://www.something.com/buy/index.php?p=025823 The .htaccess I'm using looks like this: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(\d+)*$ ./index.php?p=$1 The resulting url...

htaccess error with redirect when not starting with variables

RedirectMatch (.*).html$ index.php?id=$1 This solution doesn't seem to work and I cant figure out why. Altho, this: RedirectMatch (.*).htm$ $1.html Worked. What wrong with variable not being the first literal in replacement url? ...

How do I redirect a subdirectory and all files in it to the root using htaccess?

I'm trying to redirect all requests for a subdirectory and any files in it to the root directory, using htaccess. Currently I have redirect 301 /directory/ / But this redirects to the root with the file name requested appended to it.. ie www.domain.com/directory/this.html redirects to www.domain.com/this.html I don't want it to request...

.htaccess question - URL-rewriting.

Hello. I have an issue with URL-rewriting in .htaccess. Here is .htaccess file: RewriteEngine On RewriteBase /community/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^view-all-results$ forums/index.php?view=view-all-results [R=302] RewriteRule ^view-all-results/$ forums/index.php?view=view-all-r...

Unable to exclude directory from rewriting rules

Hi, I tried to do this in many ways, but I really cannot exclude directory "progress" from wordpress rewriting rules in .htaccess. I found many solutions but none of them seems to be working. .htaccess in root directory of wp contains: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENA...

URL routing in codeigniter

Hello all I have been using .htaccess files to redirect some of my renamed controllers/actions. Say for example... RewriteRule ^top/index/?(.*)?$ /index.php/home/index/$1 [L] Can I use the config/routes.php file for the same purpose or is it that routes.php can only be used for URL rewriting or is is that it recognises the controller...

converting htaccess to nginx, some help wanted

Anyone can help me fix below code? I did an auto convertion but many essentials were not converted RewriteEngine On RewriteCond %{REQUEST_METHOD} ^GET RewriteCond %{DOCUMENT_ROOT}/website/var/assets%{REQUEST_URI} -f RewriteRule ^(.*)$ /website/var/assets%{REQUEST_URI} [PT,L] RewriteRule ^website/var/tmp.* - [PT,L] RewriteRule ^website...

Http authentication change working directory

What I would like to do is for my users to log in with http authentication. Based on their login username the working directory will be different. I need to use http authentication because I don't want to interfere with the web application (drupal) that is in the users working directories. I also don't the users to have access to the o...

simple(?) htaccess rewriting issues

hello people, OK I have been messing about with URL rewriting for the last few days and seem to have come to a bit of a dead-end. I have come up with a few solutions that work on some servers and not others, and my hosting company (1and1 - be vary wary of these guys if you choose them as hosts) hasn't been able to help at all. My prob...

CodeIgniter and htaccess - Protect a specific controller and its methods via AuthType?

I have an admin controller which has some methods that I want to protect. http://blabla.com/admin/ http://blabla.com/admin/edit_coupon/ http://blabla.com/admin/edit_photo/ I don't need a full blown authentication system for this site, so I'd prefer to just utilize htaccess and AuthType for any /admin/ URLs. My current .htaccess is ...

Help in mod_rewrite

I'm lousy at regex and need a .htaccess rewrite rule for a following link "/eventi/123/title-of-the-event" to "/dogadjanja/123/title-of-the-event". Thanx. ...

Should I block bot*?

Hello, Bandwidth on one of our sites was severely messed with on the 28th of this month. The cpanel only tracks daily access logs and didnt archive them(it does now), using aw stats I found our bot traffic to be as follows: Unknown robot (identified by 'bot*') 91541+417 4.78 GB 28 Jul 2010 - 07:12 I have blocked bot* using htaccess: ...