.htaccess

Is there an issue with this .htaccess which would really slow down a page request?

Since adding this basic .htaccess to my index directory, each page load slows down by maybe 20-30 seconds: Options +FollowSymlinks RewriteEngine on RewriteRule ^(.+)-(.+) movie.php?id=$1 [NC] Is there some malformation or bad regex formatting here? I can't see anything wrong with it. Thanks! As an update, just these 2 lines are eno...

Convert IIS rules to HTACCESS

Hi, how does one convert IIS Rewrite rules back to Apache/HTAccess rewrite rules? I'm looking at converting this: <rule name="SEO"> <match url="^([^/]+/)*([^/]+)\.(\d+)$" ignoreCase="false" /> <action type="Rewrite" url="index.php?id={R:3}" appendQueryString="false" /> </rule> Thanks in advanced! ...

htaccess & htpasswd not hooking up correctly

Every time I try to go to Art School on Home Page and put it the correct username/password I get a server error. Yes this is homework, and yes it is my first time doing anything related to this type of setup so any help would be appreciated. All the various instructions that I found listed this as the correct way so I'm sort of stuck. ...

htaccess rewrite is giving me 500 error?

i have this url that i wanted to make friendly, using rewrite on .htacess but it gives me an error(500 internal server error), this is my orginal php url http://www.example.com/viewtopic.php?topic=lovetopic i want to change it to this: http://www.example.com/lovetopic this is my whole htaccess code is this: RewriteEngine On Rewrit...

how to protect php file with .htaccess from downloading with php5 crashed

Hello, Last night I made some admin changes to my webserver. I use php. The php processor failed after the update and if someone went to my homepage, the php page would simply download and show the proprietary code and password to anyone visiting. So I was wondering if there is a way to prevent any form of download for php files using ....

htaccess with multiple get variables

Right now im sending my errors to my script using the following Say my error is an invalid username, i redirect to domain.com/error/username RewriteRule ^error/(.+)$/ index.php?switch=error&errortype=$1 [L] but say i wanted to also pass the erroneous value as well, i tried the below, but it looks like its not the correct way. Redire...

Help with URL rewriting using .htaccess

I have html static files on my server. I want the access rules as - If user visits http://example.com/test/ he should get the contents of the file http://example.com/test.html If the user visits http://example.com/test (without the trailing slash), he gets redirected to http://example.com/test/ (which runs rule 1 and gets him the conte...

mod_rewrite {QUERY_STRING}

I'm sure that's been asked zillions times but i can't get it to work, i'm trying to rewrite a url with querystring, my url is for example: http://example.com/articles/index.php?keyword=book and i want to be accessible from http://example.com/articles/keyword/book/ I google it and i didn't have any luck, am i on the right track? i ...

rewrite rule problem?

i have this problem with my url rewrite condition in .htaccess file, everything is working fine, but when i just type www.example.com on the browser to go to my homepage' it thinks its viewtopic.php file: my viewtopic files are rewritten to be like this: www.example.com/topic this is my code: RewriteEngine On RewriteCond %{REQUEST_F...

Why is Apache not redirecting a folder it should be and not compressing?

Ok, so this problem recently arose and I don't know why it is happening; it's actually two problems in one... 0. My .htaccess file, for reference. Options -Indexes +FollowSymLinks RewriteEngine On RewriteBase / ErrorDocument 400 /index.php?400 ErrorDocument 401 /index.php?401 ErrorDocument 403 /index.php?403 ErrorDocument 404 /index.p...

Complex .htaccess question

Assuming I have the following file structure: www.example.com/index.php (home page) www.example.com/about.php www.example.com/services.php www.example.com/contact.php How can I use mod_rewrite in an .htaccess file so when the browser points to: www.example.com/about.php the actual URL displayed will be: www.example.com/about/ However...

mathematical operators in htaccess file

is it possible to use mathematical operators in .htaccess file? for example i want to redirect a page with id=100 to a page with id=30 ? ...

apache - redirect subdomain to another domain

Hi, I need to redirect every subdomain into the domain it belongs changing the subdomain name into a parameter using mod_rewrite, and I'm not sure how. Also, I need to "reindex" the parameters so that the subdomain name becames the first parameter of the uri and the other parameters of the uri follow it by their own order. Something lik...

HTACCESS - Block everything but specified SEO friendly URL

Hi, I haven't found all the answer to my current problem. Here is the root of the site: cache img display.php admin.php What I need is to block all the direct access of the files and allow only access via url formatted like that: 1 ht*p://sub.domain.com/image/param/size/folder/img.jpg (param, size, folder, img are parameters) 2 ht*...

Quickest way to rewrite urls to lowercase?

I'm looking for a way, preferably with .htaccess to rewrite a url when a user types in something with a capital. For example, the url could be website.com/pagename and the usertypes in website.com/PageName or website.com/PAGENAME Whats the best way to do with without slowing down page load? ...

SEO Friendly URL to Dynamic Arabic Category URL using PHP

Currently I have a url like this domain/index.php?cat=مال_وأعمال I want to set things up so that our Marketing people can publish url's like domain/مال_وأعمال I've tried several solutions including: mod_rewrite - the problem with this approach is that it becomes a huge .htaccess file since we need to write a rule for each category....

Apache rewrite rule

I am a rewrite newbie, I am wondering why this rewrite rule is not working, it ceases Apache from starting RewriteRule ^([-a-zA-Z0-9_]+)?/constant/([-a-zA-Z0-9_]+)/(.*)$ http://$2.domain.com/$1/$3 [R=301, NC] What this rule should do is URL refactoring, examples: http://www.domain.com/controller/constant/variable/action should be red...

.htaccess redirect for .html

I have a site constructed using the TinyButStrong template system, so consisting of pairs of .php pages with .html templates. What rules should I use in a .htaccess file such that any call to a .html page is redirected to the .php? ...

CakePHP webroot not accessible on new Apache setup

I've just set up a new Ubuntu 10.4 slice on Slicehost, and have installed apache, mysql and php. I've uploaded my CakePHP app and everything is running fine, except for the webroot being inaccessible. I have tried adding AllowOverride to all in /etc/apache2/sites-available/default and followed the Cake instructions to httpd.conf by addi...

.htaccess, conflict in rules.

I am just trying to understand how .htaccess work and what is right way of dealing with it and I have one problem. Here is part of my .htaccess file: RewriteEngine on RewriteRule ^(.*)/css/(.*)$ /css/$2 RewriteRule ^(.*)/img/(.*)$ /img/$2 RewriteRule ^(.*)/js/(.*)$ /js/$2 Everything is looks fine and have worked ok, till I'll try to ...