WAMP & .htaccess
Posted by: firoz (199.52.13.---)
Date: May 01, 2008 04:46PM

Hi,
I am facing a critical issue with a web 2.0 application I am developing in right now using WAMP and I urgently need your help to resolve this.

I dropped a .htaccess file at root folder of my site for clean search friendly urls, and everything seems working. Problem is that if I have a page with name “user.php” for example, apache automatically associate with redirect url “user”. In other words, if I type [www.application-path.com], apache automatically calls “user.php”. Same way, if I call “about” it calls “about.php”. NOTE: I didn’t put any line in .htaccess to associate “/user” to “user.php”. This kind of automatic rewrites creates problem with my actually rewrite statement in htaccess file.

So I guess somewhere in apache or mod_rewrite module, it has been configured this way. I am not sure where should I look in configuration file for fix this issue.

Did anyone else face this kind of problem with htaccess?

PS: My development machine has MS Vista OS.

Thanks, Firoz

Options: ReplyQuote
Re: WAMP & .htaccess
Posted by: toivo (---.nsw.bigpond.net.au)
Date: May 01, 2008 10:49PM

Hi,

That behaviour does not sound like something mod_rewrite does by default. Are you sure your .htaccess does not contain a rule which does this?

How does your .htaccess file get updated, just manually or do you have an application that creates it from something else?

Does your web application have a SEF component which has its own rules? I am thinking along the lines of Joomla and SEF404.

REgards,

toivo
Sydney, Australia

Options: ReplyQuote
Re: WAMP & .htaccess
Posted by: firoz (---.hsd1.nj.comcast.net)
Date: May 02, 2008 12:11AM

Thanks Toivo for reply.

To replicate this issue, I created a small test application in PHP. It has two php files and .htaccess:

-- user.php
<?php
echo "user test";
?>

-- user2.php
<?php
echo "user2 test";
?>

-- .htaccess
RewriteEngine On
RewriteRule ^user/(.*)?$ user2.php?login=$1 [L]



Now at browser, if I type [localhost], the text rendered on browser is “user test”. But note that in htaccess, I am rewriting to user2.php so it should be “user2 test”.

Thanks

Options: ReplyQuote
Re: WAMP & .htaccess
Posted by: firoz (---.hsd1.nj.comcast.net)
Date: May 02, 2008 12:14AM

URL I am providing to browser is:
http:// localhost / temp2 / user / john
(remove blank space between /)

and it's returning "user test".

Options: ReplyQuote
Re: WAMP & .htaccess
Posted by: firoz (---.hsd1.nj.comcast.net)
Date: May 02, 2008 12:45AM

Further to my previous post on test application, if I remove "user.php" from this application, I get this error:

404 Not Found

--------------
Not Found

The requested URL /temp2/user was not found on this server.
--------------

That means somewhere in Apache or rewrite_module, file with extension default configured with clean url (url without extension).

Please create above test application to replicate this issue in WAMP.

Sorry for spamming.

Thanks

Options: ReplyQuote


Sorry, only registered users may post in this forum.