Welcome Guest, Not a member yet? Register   Sign In
Apache 404 / Mod-Rewrite Issue
#1

[eluser]Unknown[/eluser]
Hopefully someone will have seen this before, cos I'm stuck and can't figure out the solution.

Mod-Rewrite is working on the apache install on my localhost (Ubuntu 9.04 amd64) and I can get to http://testsite/welcome/index etc. fine.

One of my pages does a background call (using curl) to controller on the same site and is not passing the POST data. The same site worked on my system before a reinstall, so it's obviously a config issue, and it works on a different system - I'm just struggling to see the difference in the apache config.

Using curl from the command line to debug I came across an odd thing, apache returns a 404 and then loads the the page and returns the output:
Quote:curl -v -d "test1=foo&test2=bar" http://testsite/account/login
* About to connect() to testsite port 80 (#0)
* Trying 10.130.0.123... connected
* Connected to testsite (10.130.0.123) port 80 (#0)
> POST /account/login HTTP/1.1
> User-Agent: curl/7.18.2 (x86_64-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10
> Host: testsite
> Accept: */*
> Content-Length: 16
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 404 Not Found
< Date: Thu, 23 Jul 2009 14:33:18 GMT
< Server: Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.1 with Suhosin-Patch
< X-Powered-By: PHP/5.2.6-3ubuntu4.1
< Set-Cookie: PHPSESSID=0cbf94bac9bf547314f6549add46f8bb; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Vary: Accept-Encoding
< Content-Length: 201
< Content-Type: text/html
<
Data Received.
POST: Array
(
)

GET: Array
(
)

* Connection #0 to host testsite left intact
* Closing connection #0

If I change it to post to http://testsite/index.php/account/login it works.

Here is the vhost conf:
Code:
<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName testsite
    ServerSignature email

    DocumentRoot "/home/nickg/Aptana Studio Workspace/testsite/htdocs/"
    DirectoryIndex index.php index.html index.htm

    <Directory "/home/nickg/Aptana Studio Workspace/testsite/htdocs">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        # AllowOverride AuthConfig FileInfo
        Allow from all
        Order allow,deny
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Can anyone see what I've done wrong?

Thanks,

Gushy
#2

[eluser]Unknown[/eluser]
Hmmm, don't know why but in a desperate move I disabled mod-rewrite, restarted apache, enable mod-rewrite, restarted apache and now it works.

Odd.




Theme © iAndrew 2016 - Forum software by © MyBB