I have a new Silex application, and only index works - .htaccess

This is my second Silex project, the first works fine. It is a one-page website with multi-language and twig support. Only multi-language doesn't work because nothing but the root route works. Not even $app->error().
The domain is dev.domainname.com/projectname/
The Directory Structure is:
/var/www
projectname
application
web
index.php/.htaccess, etc...
And this is my .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /projectname/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
</IfModule>
The rewrite module is loaded according to apachectl -M | grep "rewrite"
Edit I forgot to mention that the application is stored in /var/www/... but the document root for dev.domainname.com is actually in a deeper parallel folder, and there is a symbolic link to the folder. Not sure how relevant this is.

Related

Why is my laravel 5.1.* project not working properly on XAMPP linux

I have been working on two laravel 5.1.* projects. I have been using the built-in server and running the projects like so:
php artisan serve
http://localhost:8000
Everything has been working perfectly but now I have copied both projects and place in my htdocs directory and accessing them like so:
Project one: http://localhost/lara_rocks1/public/
This works when I simply navigate across pages but no authentication and registration function works. I use the the traits shipped with laravel to implement auth. For example, when I click login, logout etc, the page just refreshes and nothing happens. What can be the problem?
Project two: http://localhost/the_future/public/auth/login
For this case, just a blank page is shown. What are my missing out?
Below is the content of my .htaccess file in public folder:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Appreciate help
Had a same problem like yours in project 2. For me storage folder did not have write permition use:
sudo chmod -R 777 storage/
For project one they file
vendor/laravel/framework/src/Illuminate/Foundation/Auth
Here are all paths and redirects for implemented register,login,logout functions in laravel
Hope it helps

Rewrite Rule to include redirecting for an existing directory

I have the .htaccess script:
DirectoryIndex index.php
Options -Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php [L,QSA]
which will redirect all requests into the index.php script, except for existing files or directories that exist. However, I have the directory /lib which contains the libraries for the webapp, and I would like to extend the rewrite rule to redirect requests to /lib[/(.*)] (the directory and everything under it) into index.php as well, but so far, I have been having issues.
What lines do I need to add to my .htaccess file to add support for that rule?
p.s.
The webapp that I am doing this for currently exists on a test server, and is all stored under a higher base, so the lib URL at the moment is http://localhost:8080/c2/lib. I have not defined the /c2 part in the .htaccess as I am trying to keep it disparate, and only have the webapp do the processing.
I am aware that I could just move the /lib directory into a higher directory, but I am trying to do this with .htaccess.
You can add an additional rule, which rewrites all requests for /lib/*
RewriteRule ^lib/.*$ index.php [L]

fuelphp htaccess for multiple app directory not working

I have a directory structure like below.
public_html/
/abc/
/xyz/
/pqr/
there is a index.php in each these directories, abc,xyz,pqr.
now whenever is there any request like domain.com/abc/def/ghi should be rewritten to domain.com/abc/index.php/def/ghi
domain.com/xyz/def/ghi => domain.com/xyz/index.php/def/ghi
domain.com/pqr/def/ghi => domain.com/pqr/index.php/def/ghi
What should be the .htaccess file and where it should be placed?
I have .htaccess file in each directory(abc,xyz,pqr) like below, but it is not working. it is showing 404 page not found. Please guide me to handle all these rewrite conditions.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
But this is not working... If this is right .htaccess then please tell me if there is any other server side problem. I am setting up this on CentOs server.
You will probably need a RewriteBase /abc to deal with the subfolders.
I had problem with my directory access, I was needed to update the access for content directory(domain.com) in apache config file(httpd.conf)

codeigniter block me from accesing my phpmyadmin installation on subdirectory

I have my own CMS built using CodeIgniter (actually, it's not me who developed it. My client gave it to me from their previous developer). No, I'm in the process of migrating the CMS to a new server. I set it up and everything works fine. Except, I can't access my phpmyadmin installation which reside on the subdirectory of my public_html (which contain the CodeIgniter CMS).
www.mysite.com <-- this to access my CodeIgniterCMS based website
www.mysite.com/phpmyadmin <-- this to access my phpmyadmin
installation, which currently inaccessible and just showing CI's
default 404 error page
This might have something to do with CodeIgniter routing configuration or htaccess file and stuff like that. But I'm a total newbie on both CodeIgniter and htaccess.
What should I do to make me able to access my phpmyadmin?
this is my codeigniter htaccess file
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
let me know what other information (chunk of code, config files etc) should I show here to give better detail of my environment
Your htaccess is not poking a hole through to let access to phpmyadmin.
try
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond $1 !^(phpmyadmin|index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

How to run concrete5 in a subdirectory?

I've put my concrete5 installation in the subfolder /www/concrete5. I've tried different entries in my .htaccess file but all modes seem to have some errors.
There is mainly one forum post about it
Domain root - CMS link problem
but it does not seem to work in edit mode. However, this forum post is quite old.
Is there a simple way of accessing a concrete5 installation in a subdirectory as if it were in the root?
Here is a detailed description on how to do this:
http://www.concrete5.org/documentation/how-tos/developers/hide-the-subdirectory-url/
What does your site.php file look like?
I run a lot of cms sites from subdirectories and my htaccess file is pretty standard:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
I do the directory specific settings in the site.php file in the config directory.
define('BASE_URL', 'http://domain.com');
define('DIR_REL', '/dirname');

Resources