Can't find index.php... sort of

Need help installing Joomla! 3.x? For all Joomla! 3.x installation issues please use this forum.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
erehwon67
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat May 05, 2018 9:21 pm

Can't find index.php... sort of

Post by erehwon67 » Sat May 05, 2018 9:32 pm

In searching the web I see plenty of responses but none seem to be working. I am sure that this is a simple issue for those that are more experienced.

My install is in /web/joomla. I'm using a Synology system with PHP, Apache, etc. installed.

If I place index.html in my /web directory, then I see what is in my index.html file.

If I go to www.mysite.com/joomla/index.php My default joomla install works just fine.
If I go to www.mysite.com/joomla... 403 error
If I delete my HTML page and go to www.mysite.com I get a 403 error.

I want www.mysite.com to pull up my joomla/index.php page.

I have tried setting "DirectoryIndex index.php", "RewriteBase /joomla"" in the .htaccess in my /web/joomla directory.

I have commented out nearly everything now and was trying various changes to get the redirect to work.

----------------
# Synology PHP
AddHandler default-handler .htm .html .shtml
AddHandler php-fastcgi .php
AddType text/html .php
Action php-fastcgi /php56-fpm-handler.fcgi
# Synology PHP

##
# @package Joomla
# @copyright Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line 'Options +FollowSymLinks' may cause problems with some server configurations.
# It is required for the use of mod_rewrite, but it may have already been set by your
# server administrator in a way that disallows changing it in this .htaccess file.
# If using it causes your site to produce an error, comment it out (add # to the
# beginning of the line), reload your site in your browser and test your sef urls. If
# they work, then it has been set by your server administrator and you do not need to
# set it here.
##

## No directory listings
<IfModule autoindex>
IndexIgnore *
</IfModule>

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

DirectoryIndex index.php

## Mod_rewrite in use.

###RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
###RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
###RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
###RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
###RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
###RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment the following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

RewriteBase /joomla

## Begin - Joomla! core SEF Section.
#
###RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
###RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
###RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
###RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
###RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

dragonrider
Joomla! Ace
Joomla! Ace
Posts: 1070
Joined: Mon Aug 22, 2005 7:53 pm
Location: Ilkley, West Yorkshire, UK
Contact:

Re: Can't find index.php... sort of

Post by dragonrider » Thu May 10, 2018 2:24 pm

Change your mysite.com/index.htm(l) file as follows:

<meta http-equiv="refresh" content="0; URL='http://mysite.com/joomla/index.php' " />

You shouldn't really need the index.php bit, but better safe than sorry.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30940
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Can't find index.php... sort of

Post by Per Yngve Berg » Thu May 10, 2018 3:35 pm

Move the Joomla installation up one folder to the web root or set the web root to /web/joomla for that domain. This can be done with the Virtual Server setup in apache.conf

erehwon67
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat May 05, 2018 9:21 pm

Re: Can't find index.php... sort of

Post by erehwon67 » Sat May 19, 2018 3:44 pm

Thank you both for your replies. I ended up making the index.html change which worked well. I will likely play around with moving the directory up one level. I'm using a Synology default install which keeps wanting the directory to be where it is.

The next question would be... if I added a second site, it the second approach ultimately better?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17443
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Can't find index.php... sort of

Post by toivo » Sat May 19, 2018 4:49 pm

If you want to have more than one site, virtual hosts is the way to go in Apache.

Use the ServerName directive and if your sites are just in the LAN, edit the hosts file so that you can use dummy domain names.
Toivo Talikka, Global Moderator

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30940
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Can't find index.php... sort of

Post by Per Yngve Berg » Tue May 22, 2018 8:09 am

Also set index.php as default file instead of index.html


Locked

Return to “Installation Joomla! 3.x”