.htaccess

jirkap / 2007-04-17 09:17:27   

hi Vaska,

I've got a minor problem with .htaccess:
I am sure my webhost has mod_rewrite enabled. But it still keeps getting me 404 error when accessing any page except 'Main'. I believe there is a problem at the last line in .htaccess:

RewriteRule ^(.+) index.php

Indexhibit is installed in www.supernode.eu (but as far as i know it should not matter where it is placed, or am I wrong?) Unfortunately I don't understand regular expressions enough to get it to work. I give up :) I don't really care about it, but maybe it is something really stupid and simple to correct...

cheers
jirka

Vaska A / 2007-04-17 09:37:12   

I don't believe that mod_rewrite is working properly on your server - the htaccess file is pretty basic. The last line directs everything through your index.php file - if you get the 404 error it means that mod_rewrite is simply not doing it's job.

jirkap / 2007-04-17 09:42:47   

ok, thanks, I'll try to contact server admin.

Vaska A / 2007-04-17 11:31:38   

For future reference...Jirka came up with an alternate version...this might be helpful for others in the future if they have problems and they know 100% that their server does have mod_rewrite:

RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) - [PT,L] RewriteRule ^(.+) /indexhibit/index.php?/$1 [L]
ziadziad / 2008-11-18 02:50:59   

Hi.
I've been experiencing problems with my htaccess file for a week. Just like Jirkap, I can only get to my main (index) page through a browser. Any other links leads to Error 401 -not found- along with a random search engine.

I contacted my provider and I was told that someone manipulated my htaccess file and that I had to restore it to its original version. Here's what I was told:

"We have found that your .htaccess files have been changed to have mod_rewrite rules which apply to random search engines, so you just need delete .htaccess files from your domains folders. Specifically they are redirecting to sites that "advertise" antivirus2008 or antivirus2009 when several search engines try to spider the original site.

Please note that your files are located on the Linux-based server and you are able to change file/folder permissions so make sure you do not have any "open" files/folders with write permissions set for all. So please check if any folders has full granted permissions 777 set, which is means that it's worldwriteable for anyone from the Web. Recommended permissions are 755 or 644."

So I restored the htaccess file to the original (the one available through the current indexhibit download, which might not be the same as the one I used a year ago) But that did not fix my problem. I also tried the htaccess version you suggest on this page... didn't work.

here's what I'm thinking:

-I might not be putting the htaccess file in the right place on the server.
-I might need the htaccess file i originally used a year ago?
-What should I do about the permissions recommendation? it contradicts indexhibit's requirements...
-Any other ideas/suggestions/recommendations/help?

THANKS

ziadziad / 2008-11-18 03:01:20   

i also noticed that I have 3 htaccess files on my server: one on the first "page", one within the ziadnaccache.com folder, and one within the ndxz-studio folder. Is it normal?

FYI take a look at www.ziadnaccache.com, try clicking anything... get error 404! :)

ziadziad / 2008-11-18 03:06:59   

sorry, 4 htaccess files. found another one in Stats folder.

ziadziad / 2008-11-18 03:08:31   

sorry, 4 htaccess files. found another one in Stats folder.

ziadziad / 2008-11-18 10:54:21   

sorry for multiple posts...

Vaska A / 2008-11-18 11:49:16   

Sounds like hacking...doesn't sound like an Indexhibit issue.

ziadziad / 2008-11-18 21:57:59   

yes it was hacking indeed... The systems admins adjusted the permissions on some root files in the cgi-bin folder (i don't know the purpose of that folder) and now the site is back! Thanks anyway Vaska. I'm only worried about permissions now, I don't want this to happen again. But for Indexhibit to work you need to set permissions to 777 on a few folders, which my provider told me not to do...

Vaska A / 2008-11-18 22:00:45   

Well, if you are going to run any kind of blog or cms you need some 777 permissions...even Wordpress needs some 777 folders. If your provider was completely opposed to it then they would say so...they allow it because tons of people need and want it.

matthewoliver / 2010-09-04 09:27:30   

Hello all,

I've made some modifications to my website, I moved it from from a subfolder to the apache document root.
I'm getting 404 not found on all pages except the main page.
Everything was working fine before (clean URLs, modrewrite, ...) I've tried messing around with files/folders permissions, unpublish/publish/renaming exhibitions, nothing's happening...

If you guys have any ideas: matthewoliver.fr

ps: here's my .htaccess

  1. RewriteEngine On
  2. RewriteCond %{REQUEST_FILENAME} !-f
  3. RewriteCond %{REQUEST_FILENAME} !-d
  4. RewriteRule ^(.*)$ /index.php/$1 [L]
matthewoliver / 2010-09-05 08:41:01   

OK, I finally figured it out... I forgot to modify the virtualhost settings.

This thread has been closed, thank you.