Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

application uses url like http://www.mydomain.com/item/3193.html to select and show proper record from mysql database.

just to mention, application is written in php, hosted on apache web server..

in fact that should be http://www.mydomain.com/item.html/3193.html, but in .htaccess i have RewriteRule that helps me to treat it like http://www.mydomain.com/item/3193.html

but on the new server that RewriteRule, from some reason does not work. as i said, it is defined in .htaccess with:

RewriteEngine On
RewriteBase /
#some conditions here
RewriteRule ^item/(.*) item.html/$1
#more conditions here

so, it works on old server. it (looks like ?) that it's not working on new server...

so, first of all, i will check with hosting provider if rewrite rules are allowed on server.

also, if they are (and i guess that they are), can i change syntax for this RewriteRule, to get ability i need?

thank you very much in advance!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It is more likely that you don't have permission to setup .htaccess files. Try to do some basic things like directory listing (without having an index{htm,html,php} or any default page you might have) using Options Indexes

If you are unable to see directory contents, the AllowOverride is set to None (or something restrictive) and that is your problem. It must at least be set to AllowOverride FileInfo and Options FollowSymLinks is also required. Talk to your provider if you really need it (*).

In case you can view the directory listing, then you don't have the required options, and then again, talk to your provider.

(*) RewriteRules are OK inside an .htaccess in a staging or development server where you are trying to get a job done fast without restarting apache many times. If you can, be sure to move them up to virtualhost configuration once your on production.

share|improve this answer
    
syntax in my .htaccess is ok, right? i can setup and use .htaccess, but it doesen't work for RewriteRule... i talked to hosting provider, and he confirmed that i can use .htaccess to write my own rules... –  user48058 Sep 30 '10 at 11:49
    
Yes syntax is OK as long as the working directory is efectively the root of your site. Otherwise RewriteBase should make that clear (i.e. RewriteBase /some/path/). Ask them what is the configuration for AllowOverride and Options. That should give us a hint on why they do not work. –  Torian Sep 30 '10 at 14:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.