PDA

View Full Version : Apache htaccess problem in live site



swapnet
August 2nd, 2008, 01:42 AM
hullo,

Following is the content of my htaccess file



Options +FollowSymlinks

rewriteEngine on

RewriteRule ^.htaccess$ - [F]

RewriteCond %{REQUEST_URI} !rss
RewriteCond %{REQUEST_URI} !admin

RewriteCond %{REQUEST_URI} ^.+/(.+)/
RewriteRule ^([^/]+)/$ ?action=$1 [QSA]

RewriteCond %{REQUEST_URI} ^.+/(.+)/(.+)/
RewriteRule ^([^/]+)/([^/]+)/$ ?action=$1&p=$2 [QSA]

RewriteCond %{REQUEST_URI} ^.+/(.+)/(.+)/(.+)/
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ ?action=$1&p=$2&k=$3 [QSA]


This script is perfectly working in my local server. but I tried uploading it into the live website (I placed a copy of the htaccess in the root (/) and public_html (with other files) and it isn't working at all.

I get a 404 error (if I type say, products/resellers/ in place of ?action=products&p=resellers) saying that the file is not found.

simplistik
August 2nd, 2008, 08:44 AM
get rid of


RewriteRule ^.htaccess$ - [F]

swapnet
August 2nd, 2008, 09:24 AM
nope, didn't help.
well the thing is that apache and my relationship is only a week old so we aren't really used to each other.
so you guys will have to come for rescue.

please...

swapnet
August 4th, 2008, 03:54 AM
This is my final htaccess which is now functional.

RewriteEngine On

Options +FollowSymLinks -MultiViews

#RewriteRule ^.htaccess$ - [F]

#RewriteCond %{REQUEST_URI} ^.+/(.+)/(.+)/(.+)/
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ ?action=$1&p=$2&k=$3 [L]

#RewriteCond %{REQUEST_URI} ^.+/(.+)/(.+)/
RewriteRule ^([^/]+)/([^/]+)/$ ?action=$1&p=$2 [L]

#RewriteCond %{REQUEST_URI} ^.+/(.+)/

RewriteCond %{REQUEST_URI} !rss
RewriteCond %{REQUEST_URI} !admin
RewriteCond %{REQUEST_URI} !italk

RewriteRule ^([^/]+)/$ ?action=$1 [L]

... and the lucky website is www.qcnltd.com.. Have a look and let me know how u liked it,.

robert25
August 5th, 2008, 12:32 PM
I was facing same one thanks for www.qcnltd.com