I installed flexi auth demo on my online website & it works fine.
But I have problem on localhost. I want to customize it & for that I need to work on localhost. I have following settings: local host with CI + XAMPP + Windows 7
Directory structure:
http://localhost/xampp/prj/pub <- Here I have index.php & .htaccess file
http://localhost/xampp/prj/main/system <- This is CI System folder
http://localhost/xampp/prj/main/application <- This is CI Application folder
My .htaccess file is:
IndexIgnore *
RewriteEngine On
RewriteBase /prj/pub/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L,QSA]
I use [http://localhost/xampp/prj/pub] to access the flexi auth demo & it opens main page. But when i click “Try the Demo” it takes me to xampp default web root i.e. [http://localhost/xampp] & shows directory listing of this folder.
I have been checking by changing base path & different .htaccess parameters but no success. At present I have set my base url : [http://localhost/xampp/prj/pub/] in auth_lite.php file.
I think the problem is in .htaccess or settings of xampp need to be changed.
Can anybody help me ?
Try moving your prj folder out of the xampp directory so that is a subdirectory of the htdocs folder. Then you can access it via http://localhost/prj
You may also need to alter the base_url in the config file: application/config/config.php
Any errors can be found in the php/logs directory of your xampp root.
in config.php
$config['uri_protocol'] = 'AUTO';
change it to
$config['uri_protocol'] = 'PATH_INFO';
in codignater Framework
Related
I have 3 php apps on one server. I cant modify any apache files. Haw can I set .htaccess to remove web/ folder from url?
192.168.45.54/app1/
192.168.45.54/app2/
192.168.45.54/app3/web - I want to change it to 192.168.45.54/app3/
On adress 192.168.45.54/app3/web/ everythink is working fine. But haw can I remove web/ from url?
I created .htaccess files:
RewriteEngine On
RewriteBase /app3
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web/$1 [QSA,L]
But when I go to 192.168.45.54/app3/ in symfony log files I have fallowing error:
No route found for "GET /app3/"
I use Symfony in 3.4 version. I think that problem is in .htaccess located in /web directory... Haw to configure .htaccess corectly?
I can't create virtual host becouse I haven't access to the server...
You need to make the web/ directory the document root of your website. If you have direct access to the webserver’s virtual host configuration, change the document root to the following line and restart Apache:
DocumentRoot /path/to/symfony/web/
If you can’t modify the virtual host file directly, your hosting provider will usually give you the possibility to modify the document root through some kind of online tool.
I just started using Azure and created a Linux web app.
I followed the domain DNS tutorial and setup my domain :
https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-custom-domain
I used the custom domain - text type
test.com does not point to the folder /site/wwwroot on the app.
I placed the site folder in /wwwroot
However, in laravel - the actual site is in /sitefolder/public
How do I point to this folder?
Thanks
It has nothing to do with DNS. What you need to do is create a .htaccess file containing the following code and place this file in Laravel's root directory.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
More on this:
How can I remove "public/index.php" in the url generated laravel?
Apache rewrite for Laravel /public
Recently working with MURA CMS with RAILO on UBUNTU. I am installing MURA in inner folder of root directory.
public_html >> website.
Following code added in .htaccess to rewrite URL to run website without index.cfm and website directory.
Options +FollowSymLinks
RewriteEngine On
DirectoryIndex index.cfm
RewriteRule ^$ /website/ [R]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^website/([a-zA-Z0-9/-\s]+)$ /website/index.cfm/$1 [PT]
So my url http://example.com/website/privacy/ rewrite as
http://example.com/website/index.cfm/privacy/
I think rewrite rule should work correctly as I have tried some online validator and giving me correct result but if run it into MURA it produce URL like
http://example.com/website/index.cfm/privacy/index.cfm
I am not sure who is adding last index.cfm (apache or mura) and this take me to 404 page everytime.
Please help... this driving me crazy..
Thanks,
Pritesh
UPDATE
I have same site setup with windows/IIS 7 under subfolder of root and work fine though, if that help
To take off index.cfm of the URL, you have to edit file settings.ini.cfm
To edit this file
go to Modules / File manager
Then tab Application Root
Select folder config
Then right click on settings.ini.cfm and edit
In this file, siteidinurls and indexfileinurls have to be at 0
siteidinurls=0
indexfileinurls=0
After change, you have to reload application by clicking on Reload application on the Settings menu at the top of the window.
Thanks Matt and Mael for spending time for this issue.
Finally figure it out that TOMCAT was causing issue and adding index.cfm at the end.
<url-pattern>/website/index.cfm/*</url-pattern>
Add above URL pattern in web.xml file and it start working fine.
I'm trying install my codeigniter application in a sub folder: http://website.com/sub_folder
And I want that this site is accessible through: http://website.com/
I have the following info in my application/config.php file for the base url: $config['base_url'] = 'http://website.com/sub_folder';
This is my .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|assets|favicon\.gif|robots\.txt)
RewriteRule ^(.*)$ /sub_folder/index.php/$1 [L]
The problem is that when I change the $config['base_url'] to access my asset files, like css etc al my other links using $base_url() point to : http://website.com/sub_folder too instead of http://website.com/
If I understand what you want to achieve, you're doing it wrong, simply place index.php file in your root folder and your application to the sub-folder.
Change system and application paths in index.php to where exactly they are located and you're done.
$system_path = 'subfolder/system';
$application_folder = 'subfolder/applications';
In any case, if it's possible, consider moving application and system folders out of the root directory as it will cover hundreds of potential security holes.
So after moving a live site onto a local computer for offline show casing, a lot of the links have broken because of missplaced ../ that dreamweaver puts in.
It works online because the user of that domain doesn't have permission to leave it's doc root, but not so locally.
Is there an .htaccess that I could put the root dir that would restrict or redirect back to itself when trying to navigate to it's parent?
So the site is in xampp/mysite/ and an img src has a value of ../images/image.png
So it's looking for the image at xampp/images/image.png instead of staying in it's root dir of xampp/mysite/images/image.png
I am assuming that all of your images are in the /xampp/mysite/images directory.
If so, then you could try adding the following to your .htaccess file in the root directory of your site.
RewriteEngine on
RewriteBase /
#if request is not in xampp/mysite/images/
RewriteCond %{REQUEST_URI} !^/xampp/mysite/images/ [NC]
#rewrite images to /xampp/mysite/images
RewriteRule /(.+\\.(png|jpg|gif))$ /xampp/mysite/images/$1 [NC,L]