Welcome Guest, Not a member yet? Register   Sign In
.htaccess on wamp instead lamp
#1

[eluser]mradlmaier[/eluser]
I have a Codeigniter Project, which runs flawlessly on an openSuse 11.1 (also 11.0) Linux box, where I use to do development.
Now I have to setup that very same project on a wamp server, ;-(
I expected this to be a matter of copying over the files as these are both apache server.
Unfortunately it does not work that way.
I receive a 404 error when accessing on the wamp server.

My CI app is in:

C:/privat-chat-kontaktanzeigen/

That´s part of my httpd.conf on wamp:

Code:
LoadModule rewrite_module modules/mod_rewrite.so

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

Alias /privat-chat-kontaktanzeigen/ "C:/privat-chat-kontaktanzeigen/"
<Directory "C:/privat-chat-kontaktanzeigen/">
AllowOverride FileInfo
Options Indexes FollowSymlinks
Allow from all
Order Allow,Deny
</Directory>

And that´s my .htaccess in C:/privat-chat-kontaktanzeigen/

Code:
RewriteEngine On
RewriteBase /privat-chat-kontaktanzeigen/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]

Do I miss something? It has been a while, since I last time i did configuration of apache and ci.
As I said, on 3 different Linux boxes, this works (with the unix pathes obviously).

Does anybody have an idea?

BTW, access to

http://127.0.0.1/privat-chat-kontaktanze...ser_guide/

works on wamp, just not to

http://127.0.0.1/privat-chat-kontaktanzeigen/

Thanks,
Michael
#2

[eluser]TheFuzzy0ne[/eluser]
I'd suggest changing these lines:
Code:
RewriteRule ^(.*)$ /index.php/$1 [L]

To this:
Code:
RewriteRule (.*) index.php?/$1 [L]

And seeing if that makes any difference.
#3

[eluser]TheFuzzy0ne[/eluser]
Oh, and one more thing - You appear to have a mixture of two different htaccess files. I'd also suggest losing the rewrite base, as it shouldn't be needed. So, this is what I think should work for you:
Code:
RewriteEngine On

RewriteCond %{REQUEST_URI} ^system.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?/$1 [L]
#4

[eluser]mradlmaier[/eluser]
Hello TheFuzzyOne,

Thanks for the quick reply.

Unfortunately both your suggestions don´t work.

I am really annoyed about this apache configuration stuff, because I don´t have a good idea how to debug it. Would like to get back to coding with CI quickly...

How do you go about debugging/figuring out what´s wrong?

Do I miss someting else?

It should only be:
1. enable mod_rewrite, that´s
Code:
LoadModule rewrite_module modules/mod_rewrite.so
2. enable .htaccess, that´s
Code:
<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>
3. setup .htacces as you suggested.

As far as I remember, that should be all?

Best regards,
Michael
#5

[eluser]TheFuzzy0ne[/eluser]
Apparently you need to enable mod_rewrite for WAMP - http://ellislab.com/forums/viewreply/607036/
#6

[eluser]mradlmaier[/eluser]
As far i can tell, I enabled mod_rewrite already, because in C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf the line
Code:
LoadModule rewrite_module modules/mod_rewrite.so
is uncommented, and the menu entry "rewrite_module" is checked in the wampserver|Appache|Apache Modules

Any wamp specialists out there?

Michael
#7

[eluser]mradlmaier[/eluser]
I should add that the 404 Page Not Found Page is generated by CI and not the 404 of Apache, which looks different.

Michael
#8

[eluser]TheFuzzy0ne[/eluser]
If it's a CodeIgniter error page and you're certain that the controller exists, and is in the right format, then it's probably the URI protocol that needs changing in your config.php. I'd suggest trying each of them.
#9

[eluser]mradlmaier[/eluser]
OK, at least this causes some other effects:

Here are the results:

AUTO --&gt; http://127.0.0.1/privat-chat-kontaktanzeigen/ displays index page, links are 404 by Apache, http://127.0.0.1/privat-chat-kontaktanzeigen/gast/index is 404 by Apache

PATH_INFO --&gt; http://127.0.0.1/privat-chat-kontaktanzeigen/ displays index page, links are 404 by Apache, http://127.0.0.1/privat-chat-kontaktanzeigen/gast/index is 404 by Apache

QUERY_STRING --&gt; http://127.0.0.1/privat-chat-kontaktanzeigen/ displays index page, links are 404 by Apache, http://127.0.0.1/privat-chat-kontaktanzeigen/gast/index is 404 by Apache

REQUEST_URI --&gt; http://127.0.0.1/privat-chat-kontaktanzeigen/ displays page 404 by CI, http://127.0.0.1/privat-chat-kontaktanzeigen/gast/index is 404 by Apache

ORIG_PATH_INFO --&gt; http://127.0.0.1/privat-chat-kontaktanzeigen/ displays index page, links are 404 by Apache, http://127.0.0.1/privat-chat-kontaktanzeigen/gast/index is 404 by Apache

I should also add that the site is using routes (to enable search-engine-friendly dashes in method names). All this is working flawlessly under Linux.

Michael
#10

[eluser]TheFuzzy0ne[/eluser]
That's very strange. I guess that rules out any problems with case sensitivity, which was going to be my next suggestion. I'm totally baffled, and I hope that someone else may have an idea of what's going on. If the worst comes to the worst, would you be able to zip up your code and put it somewhere for me to download and check?




Theme © iAndrew 2016 - Forum software by © MyBB