Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

SOLVED: Homepage returns 404 on Alias domain
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: SOLVED: Homepage returns 404 on Alias domain

SOLVED: Homepage returns 404 on Alias domain 16 years, 9 months ago #3857

Hello everyone,
I would like ask you for a help with the following problem:

Installation:
!Joomla 1.0.13 stable + JoomSEF 2.2.6 + JoomFISH 1.7 (2006-05-01)

Explanation:
I have a hosting running on domain1.com - there are several aliases set for this hosting and each alias is running different website. I want run !Joomla website on domain1.com so I did set in the root .htaccess these settings:

 
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} domain1.com
RewriteCond %{REQUEST_URI} !company_web_dir/
RewriteRule ^(.*)$ company_web_dir/$1 [L]
 


Than I have regular .htaccess distributed with JoomSEF component in /company_web_dir/ directory.

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

RewriteBase /
 
 
########## Begin Standard SEF Section
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteRule ^(content/|component/) index.php
#
########## End Standard SEF Section

 
########## Begin 3rd Party or Core SEF Section
#
#RewriteCond %{REQUEST_URI} ^(/company_web/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /company_web/(.*) /company_web/index.php
#
########## End 3rd Party or Core SEF Section

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a tag in URL
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
 


Problem:
Everything works PERFECT EXCEPT HOMEPAGE. I always get JoomSEF 404 error on homepage. Other pages works correctly with no problems.

I tried following to fix this:
I also checked this forum and tried different tips I found - like setting directory index, or edit line with index.php text to:

 
RewriteRule /company_web_dir/(.*) /company_web_dir/index.php
 

-> didn`t help

Than I found changing setting in JoomSEF component configuration:
Redirect nonSEF URLs to SEF? -> Set to YES
-> didn`t help

If I set \"404 page\" in JoomSEF configuration to Frontpage - I get Error page saying, that I got to loop in redirection
-> didn`t help

If I set \"404 page\" in JoomSEF configuration to Home - I get Home page -> it has also Homepage title now, but insteed of homepage content it says \"FILE NOT FOUND\"
-> didn`t help

If I turn off JoomSEF, but I will keep turned ON \"Search Engine Friendly URLs\" in !Joomla global configuration panel, everything works perfect including Homepage, but I don`t have that nice URLS
-> didn`t help - SEF URLS in Joomla works but not in JoomSEF component

I am not a new user in !Joomla, either in JoomSEF component, but I did never run Joomla in this kind of directory hierarchy.

Thank you for ANY suggestions
igi
Last Edit: 16 years, 9 months ago by iguana007.

Odp.:Homepage returns 404 on Alias domain 16 years, 9 months ago #3858

I finally found the solution on this forum ....

notzippy napsal:

Like most sites I dont install joomla in the root, but install it in a subfolder off of the root. I was able to get the htaccess to redirect properly from the root using the simple redirect

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^mysite
RewriteRule (.*) /mysite/$0

And this functioned perfectly within joomla. However when sef was enabled I kept getting page not found errors. (These were wrapped nicely inside the template). After some investigating I found the culprit. com_sef/sef.php configures a variable called $base which is set to what it thinks the \"root\" of the server. It does this by using dirname function and the likes. This file calls joomsef.php which uses the global base php variable (defined in sef.php) to determine a matching path for the request. Unfortunately this does not take into account that the request has been initially redirected. So if the request was for
me.com/about.htm
the sef would try to match the base of the request (\"/\") with \"mysite\" since it didnt match it gives the 404 error.

The fix was a simple hack. modify joomsef.php and after the
 
global $database, $URI, $my, $option, $index, $base;
 

Add in
 
$base = \"/\";
 


This overrides the \"calculated\" url request base.

This is an excellent module, I hope that this option could be added to the configuration panel

Z

Re:Odp.:Homepage returns 404 on Alias domain 16 years, 7 months ago #4142

This worked like a charm for me. Thanks! I was stymied for a bit because I had set the initial redirect in the panel at Dreamhost. All of the SEF URLs worked except for the home page. Excellent -- this should be included in the future releases. Of course, I still need to upgrade from 2.1.x to 2.2.x, so it may be already fixed.

Re:SOLVED: Homepage returns 404 on Alias domain 16 years, 7 months ago #4143

np buddy ;)
  • Page:
  • 1
User Login Empty