Forum Moderators: phranque

Message Too Old, No Replies

htaccess not working in server. but works in local machine

htaccess not working in server. but works in local machine

         

zetan

9:59 pm on Mar 15, 2011 (gmt 0)

10+ Year Member



Hello,

I have to request help on this after spending countless hours and deciding that i am dumb and need help.
I have the following in an htaccess file in a subdirectory. My aim is to redirect all urls containing pattern 'store' to index.php in the current directory. which is also named 'store'.

IndexIgnore *

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !^/store/
RewriteRule (.*) index.php [L]



Now this works well in my local machine running winxp & AMP .

but it results in a 404 error when the same setup is moved to my webserver. (Centos LAMP)

Any help towards making this htaccess file work in my webserver will be greatly appreciated.

Zetan

topr8

7:51 am on Mar 16, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ok, i'll ask the obvious first.

you have uploaded index.php to your server?

brotherhood of LAN

7:59 am on Mar 16, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Try adding
RewriteBase /

[httpd.apache.org...]

zetan

9:46 am on Mar 16, 2011 (gmt 0)

10+ Year Member



@topr8

Yes i have uploaded the index.php
the directory structure is www.domainname.com/cart/store/ .
rest of the directory structure will be generated based on category name and product name from db.
The index.php and htaccess are in the 'store' directory.

@brotherhood of LAN
Yes i tried adding RewriteBase / . still not working.

Thank you for replying

jdMorgan

12:59 am on Mar 18, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What (if anything) is logged in your server error log?

Also, note that while this file may be called just "htaccess" on a Windows machine, it will likely need to be called ".htaccess" on any *nix box.

Jim