Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

htaccess issue resolved
(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: htaccess issue resolved

htaccess issue resolved 17 years, 10 months ago #1523

  • notzippy
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:htaccess issue resolved 17 years, 10 months ago #1542

  • dajo
  • OFFLINE
  • Posts: 5069
Hi,

hopefully I understood your problem corectly.
Have you tried changing RewriteBase to /subfolder/ instead of changing RewriteRule? I have my site in a subfolder too and I have no problems with that, RewriteBase should do the work, no need for hacking the sef..

Best regards,
David Jozefov
ARTIO Support Team

Re:htaccess issue resolved 17 years, 10 months ago #1543

  • notzippy
Hi

Yes I have setup the .htaccess inside the subfolder which specifies the RewriteBase
So in my root I have

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

And inside the mysite folder I have an .htaccess file containing the normal stuff for joomla, with this
RewriteBase /mysite

I'm pretty sure everything is setup correctly because if I turned SEF off all the links and site content worked perfectly.When I turned it back on things I would get page not found errors captured by the sef extension.

A simple example of the issue was when I did a request for the home page "/" of the site.
This was redirected to joomla and the $_SERVER['REQUEST_URI'] = "/", however the $base = "/mysite"
So in the next switch statement the $base<>"/" and the default of the switch would be run (causing the sef).

Oh it should be noted that I am 1.4.0-beta2 of the software

z
  • Page:
  • 1
Přihlášení uživatele Prázdný