473,839 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.htaccess file is not working

160 New Member
Hi to all
I m looking for some help. i want to do url rewritting. i write code e.g
Expand|Select|Wrap|Line Numbers
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteRule index/show/(.*)/cat/(.*)/ index.php?show=$1&cat=$2
  4. RewriteRule index/show/(.*)/cat/(.*) index.php?show=$1&cat=$2
1)On local host its give an error "Internal Server Error". same error occurred even when i wrote just first two lines of above code.

2)On live site it not give any error but its not working at all. In fact there is no effect of writing above code.

is there any problem in php settings. Please send me some solution. I tried hard but did't find any solution
Feb 6 '10 #1
12 4362
5,058 Recognized Expert Expert

Have you checked the error log to see what is going on?
By default, the file is located at:
"C:\Program Files\Apache Software Foundation\Apac he2.2\logs\erro r.log". (On Windows, that is)

On Linux they can be in different places. I'd start by looking at the /var/log directory.
Feb 6 '10 #2
160 New Member
Thanks Atli for your kind reply

i opened error.log but i dont know how to check from error.log that what is going on
Feb 6 '10 #3
5,058 Recognized Expert Expert
Check the latest entries. When you get an internal server error the actual error is written into those logs.

You can post them here (not all of them, just those that happened at the time your internal server error happened) and we can help you figure them out.
Feb 6 '10 #4
160 New Member
Thanks Atil for your reply. Atil i dont think so that any thing happened in error log due to that error. i am facing this error rite now but last few lines of error log are

Expand|Select|Wrap|Line Numbers
  1. [Wed Dec 10 09:45:25 2008] [error] [client] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
  2. [Wed Dec 10 09:49:45 2008] [notice] Parent: Received shutdown signal -- Shutting down the server.
  3. [Wed Dec 10 09:49:45 2008] [notice] Child 3912: Exit event signaled. Child process is ending.
  4. [Wed Dec 10 09:49:46 2008] [notice] Child 3912: Released the start mutex
  5. [Wed Dec 10 09:49:49 2008] [notice] Child 3912: All worker threads have exited.
  6. [Wed Dec 10 09:49:49 2008] [notice] Child 3912: Child process is exiting
  7. [Wed Dec 10 09:49:49 2008] [notice] Parent: Child process exited successfully.
i also want to mention that i am using wamp and this file exist in
C:\wamp\bin\apa che\Apache2.2.1 1\logs
Feb 6 '10 #5
160 New Member
Any other reason for that problem?
Feb 7 '10 #6
5,058 Recognized Expert Expert
That's odd. The error messages should be in the log. Could be that XAMPP does something differently than a typical Apache installation.

Anyhow. Are you sure mod_rewrite is installed on the server, and that it is active?

Try wrapping the RewriteRule stuff in IfModule tags.
Expand|Select|Wrap|Line Numbers
  1. <IfModule mod_rewrite.c>
  2.     RewriteEngine On
  3.     RewriteRule index/show/(.*)/cat/(.*)/? index.php?show=$1&cat=$2
  4. </IfModule>
This will make sure the modules is active before trying to use it. If the module is not active, your rewrite rules will simply be ignored. Your site will work, but the rewrite rules will not.

I combined your two rules into one in that example. If you trail any character in a regular expression with a question-mark it becomes optional.
Feb 7 '10 #7
160 New Member
Thanks Atli,
you are right mod rewrite is not installed. i came to know this by using your code in which you use if condition
please tell me what is next step now. how i ll install it
Feb 7 '10 #8
5,058 Recognized Expert Expert
I have never really used XAMPP myself so I wouldn't know, but Google seems to have a lot of info on the subject.
Feb 7 '10 #9
160 New Member
Thanks Atil. You really help me
Feb 7 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

by: yawnmoth | last post by:
i'm trying to write a php script that will password protect some random directory by creating a .htaccess file, and a password file to accompany the .htaccess file, and it isn't working... specifically, i can't enter the newly created directory with a username of test, and a password of test, which is what i am trying to do. also, i'm testing this script out on a remote server, and... after this script runs, i can't delete any of the...
by: Ivo | last post by:
Greetings newsgroup, I am moving some php scripts to a new host. While getting to know the server, I ran into a strange problem. If I add a .htaccess file, or more specifically: a .htaccess with content, to a folder, requesting (html and php) files from that folder results in internal server error messages. If I upload an empty .htaccess file, all is fine. Then phpinfo() tells me I am using Apache/1.3.27.
by: Nel | last post by:
Just looking for some general advice on modifying the URL for php. I am using .htaccess to allow a web site to translate example.html to index.php?content=example (below) ErrorDocument 404 http://www.example.com RewriteEngine on RewriteRule ^/?(.*).html$ /index.php?content=$1
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere including the php.net manual. In the manual it said to include something like the following:
by: Jack Hambabo | last post by:
Hi, I'm searching for a php script that can find out whether the current user (I know _SERVER will give me the name for non-cgi php) has the right to view a specific file. My dream is that I just need a short php script that just asks the webserver what the rights are. That seems a reasonable wish to me. If this is however not possible than I'd like a script that can
by: asherwolf | last post by:
Hi, I'm trying to do something I think is pretty neat, but I've just about pulled my hair out by the behavior of my server. I'm hosting on GoDaddy, using a subdomain (www.mywebpage.com maps to /mywebpage), running Apache 1.3.33, and PHP 4.3.11. The goal is to use PHP to install an .htaccess file in a folder to forbid PHP files from being accessed from outside the server. I have a working .htaccess file in one folder, and I have been...
by: Thiago Macedo | last post by:
Hi folks, I have the Apacha server (2.2.8) with PHP installed as CGI Binary. This, as i'm discovering, means that I can't change php configurations through .htaccess. Is my searches right or there is a way of change a PHP - CGI Bynary - setting using .htaccess? Thanks,
by: adnanjunk | last post by:
Hi, Having a little issue with .htaccess not working on windows server. I have clean url's setup using the htaccess file, working fine on linux server. I have researched for a while and found .htaccess doesn't work on windows. Since this is a shared hosting i don't have access to httpd.conf so that i can edit it. I have been reading this forum about it. http://forum.mambo-foundation.org/showthread.php?t=1857
by: AndyPSV | last post by:
Hello, I've got .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php It works properly on mine and others servers, but not @ DOMAIN REMOVED (company, which I get free account and register domain 4 free). I writed to them and get reply:
by: Markus | last post by:
Why is it not working? I joke. Here's the info: In the folder C:\host\www\test, I have an .htaccess file. Inside that .htaccess file is the following: RewriteEngine On RewriteRule ^test1.php$ /test2.php
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.