index.php and Sh404Sef problem..

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed May 08, 2013 2:52 pm
Reply with quote
Report this post
Hi all,

I've recently purchased the News template and installed it to my current site running Joomla 2.5, K2, Sh404Sef component (sef friendly url's, no index.php in the url) etc. and had no issues except for the fact the back end of the template is quite complicated - especially the news modules.

In an attempt to make life easier for myself with regards to customizing the news template I decided to install the "quickstart" package in a sub-folder of my root domain to experiment with, this was done successfully including setting up the new mysqli database (it's mysql on my original site but I went with the default on the Joomla installation for this).

The quickstart site looks and works just like the demo on Gavick.com with one exception - when I installed Sh404Sef with and selected yes to:

Enable URL optimization - yes
Rewrite mode - with .htaccess - yes

With these settings (standard on my main site) I receive 404 error messages on all pages except for the home page.

When I disable Rewrite mode - with .htaccess on Sh404Sef the 404's are gone but all pages have index.php in front of the main url e.g. http://www. mysite.com/gk_news_quickstart_J25/index.php/the-rest-of-the-url.html instead of the desired http://www. mysite.com/gk_news_quickstart_J25/the-rest-of-the-url.html

Can someone tell me if there is an issue with Gavick templates and the Sh404Sef component, is there a way to remove index.php from the url?

Help appreciated as this is driving me nuts!
User avatar
Senior Boarder

GK User
Wed May 08, 2013 3:26 pm
Reply with quote
Report this post
Have You tried to use rewrite mode different than .htaccess one?
User avatar
Moderator

GK User
Wed May 08, 2013 3:37 pm
Reply with quote
Report this post
Hi and thanks for your reply. I am not aware of another method other than the joomla default "Use url rewriting" or the Sh404Sef component. If you could suggest something else I could try?
User avatar
Senior Boarder

GK User
Wed May 08, 2013 4:10 pm
Reply with quote
Report this post
Hmm..

So in other words, if You use combination of Joomla 2.5, K2, Sh404Sef in root of website it works ok, but if You are trying to do the same in subfolders installation the problem appears?

Have I understood You right?
User avatar
Moderator

GK User
Wed May 08, 2013 4:23 pm
Reply with quote
Report this post
That is almost correct.

Have installed the news template in:

- a sub folder with my current development site (Joomla 2.5, Sh404Sef, K2 etc.)
- no url issues but difficulty to set up news modules as they are complicated

So to try and learn from the admin area of the fully built Gavick news site.

- did a quickstart installation into another subfolder " mysite/gk_news_quickstart_J25/ "
- pages work fine if I leave index.php in the url's
- but when trying to use Sh404Sef with .htaccess rewrite to remove index.php from the url's I get a 404 error on all pages except for the home page.
User avatar
Senior Boarder

GK User
Wed May 08, 2013 4:29 pm
Reply with quote
Report this post
Could You post .htaccess content from both subdirectories when Sh404Sef .htaccess rewrite is enabled?
(Name them "working one" and "not working one")
User avatar
Moderator

GK User
Wed May 08, 2013 5:40 pm
Reply with quote
Report this post
Here you go, thanks in advance.

WORKING 1

##
# @package Joomla
# @copyright Copyright (C) 2005 - 2013 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 just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

## Mod_rewrite in use.

RewriteEngine On

## 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 base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
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 following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## 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 request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# 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.

NOT WORKING 1

##
# @package Joomla
# @copyright Copyright (C) 2005 - 2013 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 just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

## Mod_rewrite in use.

RewriteEngine On

## 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 base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
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 following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## 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 request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# 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.
User avatar
Senior Boarder

GK User
Wed May 08, 2013 6:59 pm
Reply with quote
Report this post
Could You PM me links to those sites?
User avatar
Moderator


cron