Object not found! in xampp - apache

I'm using creo's module system and laravel 4. mod_rewrite is enabled and I have a .htaccess I'm also using XAMPP. The weird thing is, if I use MAMP then it works fine but if I use XAMPP that is when I get the Object Not Found error. I would like to use XAMPP because it is much more easier to create a virtual host with it then it is with MAMP.
In my url I have
http://localhost/test-modules/index.php/admin/content
but I need it to be
http://localhost/test-modules/admin/content
here is my .htaccess
Order allow,deny
Allow from all
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Disallow access to following directories
#RewriteRule ^vendor($|/|/.*|./*) – [L,R=404]
#RewriteRule ^app($|/|/*|/.*) – [L,R=404]
</IfModule>

Do yourself a favor and don't use either MAMP or XAMP. Use homestead.
http://laravel.com/docs/4.2/homestead
To give you some guides:
https://laracasts.com/lessons/say-hello-to-laravel-homestead-two

Related

Getting 404 error when viewing CakePHP 3 app on 1and1

When I attempt to hit my site which is at mydomain.com/subfolder, I get a 404 (from Apache).
/subfolder/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
/subfolder/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
To confirm that mod_rewrite works, I added this in the /subfolder/.htaccess file which promptly redirected:
Redirect 301 / http://other-domain-owned.com/
So, .htaccess are live and mod_rewrite works.
On my development environment, I was able to make the site work in the same /subfolder by symply enabling .htaccess files for that folder via a Directory directive.
Some tutorials say to add RewriteBase / but this didn't help.
Instead of RewriteBase, you can also use an absolute path. Additionally, the first two rules can be simplified to one
RewritRule ^(.*)$ /subfolder/webroot/$1 [L]
Similar the second part
RewriteRule ^ /subfolder/webroot/index.php [L]
Finally, Redirect and RewriteRule are from different modules. So, if one of the directives is working, this is no proof for the other one working too.

How to remove http://IP_ASDRESS/index.php/xyz from laravel 5?

I know that question has been answered number of times, but I would like to tell you what I did but still I haven't manage to remove it.
Firstly I'm hosting my app on digital ocean with apache 2, and I double check that the mod_rewrite is activated. Also I add on my htaccess in the public folder the following
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
on the index.php I have the following lines
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/start.php';
$app->run();
After doing this configurations I couldn't remove the index.php/xyz.
I would like to ask if I'm doing something wrong or if I'm missing something.
Ps. the http://IP_ADDRESS is working fine with the home page.
PSS. I restart the apache 2 serval times.

Having trouble with mod_rewrite on my Laravel app

Currently, I can only access links on my Laravel project if they are in the form of domain.com/index.php/somepage. I want to be able to be able to get access with a URL like domain.com/somepage. On my local Windows machine it is working fine. My server is on Ubuntu and running Apache 2.4.6 and the rewrite module was enabled via a2enmod rewrite. My .htaccess is the default one that ships with Laravel:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I've also tried the alternate in the Laravel docs both with and without the <IfModule>:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I realize this has been asked before but I still can seem to get it working with other examples that I've seen. I'm guessing it must be some Apache configuration that I don't have set.
Did you make sure that allowoverides all was in your httpd config?
That sounds like your issue.

htaccess not working in ubuntu

Hello a couple months ago I started a website project, after weeks last night I continued developing it on my windows pc were everything worked fine.
Today I ported it to ubuntu 12.04 lts and after starting up my apache / mysql tried to hit some website urls.(set up with vhost like so: tms.localhost/path...)
The Issue I'm facing and I have no idea why is that the clean urls and the mod_rewrite doesn't seem to work. My custom php redirection - page loading script isn't being called anymore(index.php).
Here is the htaccess that is unchanged since day 1. Need to mention that works only if I just enter the vhost url like so http://tms.localhost/ if i add anything after that I get the default apache 404 page.
#Debugging - Error reporting
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
#Commpression
<ifmodule mod_deflate.c="">
<filesmatch ".(js|css|html|png|jpg|jpeg|swf|bmp|gif|tiff|ico|eot|svg|ttf|woff|pdf)$"="">
SetOutputFilter DEFLATE
</filesmatch>
</ifmodule>
Options All -Indexes +FollowSymLinks -MultiViews
<IfModule mod_rewrite.c>
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# remove spaces from start or after /
#RewriteRule ^(.*/|)[\s%20]+(.+)$ $1$2 [L,R=301,NE]
# remove spaces from end or before /
#RewriteRule ^(.+?)[\s%20]+(/.*|)$ $1$2 [L,R=301,NE]
# replace spaces by - in between
#RewriteRule ^([^\s%20]*)(?:\s|%20)+(.*)$ $1+$2 [L,R=301,NE]
# Remove trailing slash
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [L,R=301]
# Add trailing slash
#RewriteCond %{REQUEST_URI} !(/$|\.)
#RewriteRule (.*) %{REQUEST_URI}/ [L,R=301]
# Remove multiple slashes
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/{2,} [NC]
RewriteRule ^(.*) $1 [R=301,L]
# Clean url rewrite
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^.*\.(png|jpg|jpeg|bmp|gif|css|js|json)$ [NC]
#RewriteRule ^([^/]+/?.+)$ /index.php?req=$1 [L,QSA]
#RewriteRule ^(.*)$ /index.php?req=$1 [L,QSA]
RewriteRule ^(.*)$ /index.php [L,QSA]
</IfModule>
# Big thnx to anubhava for his regex help - linkedin.com/in/anubhava
UPDATE
The index.php works as a page file loader it doesn't contain any html.
Only the root url works and loads the corresponding php file, hence mod_rewrite is enabled.
htaccess fails to translate the rest of the requests I suppose ?
vhostfile tms.localhost
<VirtualHost *:80>
ServerAdmin webmaster#tms.localhost
DocumentRoot /var/www/tms
ServerName tms.localhost
#ServerAlias www.example.com
</VirtualHost>
modules phpinfo() :
core mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_reqtimeout mod_rewrite mod_setenvif mod_status
Well there was nothing wrong with it.
Apparently either the compression program or google drive (where I kept the project renamed .htaccess to htaccess...

Silex rewrite, one.com

I am using this apache rewrite, when i am on my local machine.
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /skoleskak/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
But after i uploaded it, to my host i get server error. They told me they dont support Options, but i can't get it working without that.
I am trying to route my Silex installation, so its /web/stats/ instead of web/index.php/stats.
I found this example for Codeigniter http://www.chrishjorth.com/blog/one-com-codeigniter-htaccess-rewrite-rules/
Anyone know how to make it work with Silex?
Same problem at some hosters. If your server has installed Apache >= 2.2.16 you can use the FallbackResource command:
FallbackResource /index.php
in your .htaccess instead of
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /skoleskak/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
See also Apache’s fallbackresource: your new .htaccess command for more information.