Using SEF without mod_rewrite

Do you have an Open Source Product available for Joomla!? Let everyone know here.
User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Using SEF without mod_rewrite

Post by Websmurf » Tue Aug 23, 2005 9:03 am

In continuation of the topic on the former forum:

i think i've found a rather simple way to avoid the mod_rewrite ability in order to use SEF urls

Apache
1. Enable SEF in mambo configuration
2. do NOT rename the htaccess.txt
3. open /includes/sef.php and change this line: (~ line 217)
return $mosConfig_live_site."/".$string;
to
return $mosConfig_live_site."/index.php/".$string;

For this to work, you will have to make sure AccepPathInfo is set to on in the apache configuration.

IIS
for IIS or if you can't get the above working use :
return $mosConfig_live_site."/index.php?".$string;

it could also be needed to add this to your sef.php

Code: Select all

 $_SERVER['REQUEST_URI'] = (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']);

// Append the query string if it exists and isn't null
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
  $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
} 
(just above this line
if ($mosConfig_sef) {
)

this will enable SEF urls to work without mod_rewrite at all..
and create urls like this:
http://www.site.ext/index.php/content/view/9/34/
http://www.site.ext/index.php/content/view/10/35/
http://www.site.ext/index.php/component ... Itemid,78/
Last edited by Websmurf on Wed Aug 15, 2007 2:00 pm, edited 1 time in total.
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
jema
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Fri Aug 19, 2005 9:45 am
Contact:

Re: Using SEF without mod_rewrite

Post by jema » Tue Aug 23, 2005 9:11 am

Interesting idea.

To explain a little how this works for the uninitiated. Normal sef urls need .htaccess which looks at the url, says ooh eh that does not really exists, and uses mod_rewrite to pass the url on to index.php.

This tweak means the url does actually exist as it has index.php already.

e.g.

http://www.tim-online.nl/index.php/content/view/9/34/

as opposed:

http://www.tim-online.nl/content/view/9/34/


hence it does not need mod_rewrite.

That being said, will search engines look and rank beyond the index.php in the url?

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Tue Aug 23, 2005 11:09 am

yes actually.

Our main page has pagerank 7
"Over Tim" has pagerank 5
Forum has pagerank 5

Etc
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
alikon
Joomla! Champion
Joomla! Champion
Posts: 5941
Joined: Fri Aug 19, 2005 10:46 am
Location: Roma
Contact:

Re: Using SEF without mod_rewrite

Post by alikon » Tue Aug 23, 2005 12:27 pm

Sorry for my ignorance,

my silly question is this:

for make component adhere the SEF specification  what i have to do in the code ?
Nicola Galgano
i know that i don't know
www.alikonweb.it

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Tue Aug 23, 2005 12:39 pm

do you mean making sef links in a component?

Code: Select all

echo sefRelToAbs('index.php?option=com_mycomp&act=myact&task=mytask&Itemid=111');
or am i misunderstanding you?
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
alikon
Joomla! Champion
Joomla! Champion
Posts: 5941
Joined: Fri Aug 19, 2005 10:46 am
Location: Roma
Contact:

Re: Using SEF without mod_rewrite

Post by alikon » Tue Aug 23, 2005 12:47 pm

yes, right,

another little question , we have to use sefRelToAbs() for any redirection such as form hyperlink tag and so on ...
Nicola Galgano
i know that i don't know
www.alikonweb.it

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Tue Aug 23, 2005 12:53 pm

any link users can click, can be spidered by search engines, so it would be wise to do that.
I don't think form tags etc would be usefull. Also popups (via index2.php) won't have to run through sefRelToAbs.
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
jema
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Fri Aug 19, 2005 9:45 am
Contact:

Re: Using SEF without mod_rewrite

Post by jema » Tue Aug 23, 2005 12:56 pm

Websmurf wrote: yes actually.

Our main page has pagerank 7
"Over Tim" has pagerank 5
Forum has pagerank 5

Etc
To play devils advocate. Uless you can measure what would happen to page rank with and without SEF, it is only guessing.

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Tue Aug 23, 2005 1:06 pm

very true, but pages get picked up.
i don't think it will make a difference. SEF friendly pages are just easier to index for google.
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
jema
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Fri Aug 19, 2005 9:45 am
Contact:

Re: Using SEF without mod_rewrite

Post by jema » Tue Aug 23, 2005 1:12 pm

Websmurf wrote: very true, but pages get picked up.
i don't think it will make a difference. SEF friendly pages are just easier to index for google.
My understanding was that google was better than other search engines at reading non sef pages. Some search engines don't index paramaterised links. hence basic SEF like what we have here, made little difference on the google ranks but more difference with other engine.
For google you really need the "advanced" solutions. My downsizer site does very well with google and I put some of that down to SEF advance. The advanced solutions put keywords in the urls which does help rank.

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Tue Aug 23, 2005 1:21 pm

My understanding was that google was better than other search engines at reading non sef pages. Some search engines don't index paramaterised links.
that's another thing that's true :)

yes, SEF advanced is something i will definately buy for future sites. Works very nice and isn't that expensive at all.
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
pointri
Joomla! Explorer
Joomla! Explorer
Posts: 283
Joined: Wed Aug 24, 2005 2:02 pm
Location: Rhode Island, USA

Re: Using SEF without mod_rewrite

Post by pointri » Wed Aug 24, 2005 8:26 pm

Happy to see this thread recesuitated.  This hack was a lifesaver, well, until we migrated to an Apache server with mod_rewrite.  Thanks again websmurf.

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Using SEF without mod_rewrite

Post by de » Wed Aug 24, 2005 8:46 pm

I thought I throw in another possibility which should work with Apache interpreting the .htaccess file (but without mod_rewrite):
Create the file .htaccess and make the following the only line:

Code: Select all

ErrorDocument 404 /index.php
Then if you are using 404 SEF no further action should be required... for others which probably not set the status code you may want to add the following to your index.php (next to the other header function calls you will find around line 200):

Code: Select all

header('HTTP/1.0 200 OK');
(this is describes the replacement for the renaming of the htaccess.txt... all other steps will remain the same... like enabling SEF or optionally installing an addition SEF component)

User avatar
joomlasolutions_JB
Joomla! Explorer
Joomla! Explorer
Posts: 355
Joined: Wed Aug 17, 2005 11:07 pm
Contact:

Re: Using SEF without mod_rewrite

Post by joomlasolutions_JB » Fri Aug 26, 2005 1:10 pm

websmurf--

Thanks for you help getting SEF working on IIS


:)
Joomla! Template Shop www.joomlathemes.org

Joomla Template Club
templateclub.mambosolutions.com

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Fri Aug 26, 2005 1:34 pm

not a problem :)
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

Guardian
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu Aug 18, 2005 7:13 pm
Location: France

Re: Using SEF without mod_rewrite

Post by Guardian » Sat Aug 27, 2005 1:57 pm

Websmurf wrote: this will enable SEF urls to work without mod_rewrite at all..
and create urls like this:
http://www.tim-online.nl/index.php/content/view/9/34/
http://www.tim-online.nl/index.php/content/view/10/35/
http://www.tim-online.nl/index.php/comp ... Itemid,78/
would it be possible to achieve something like:
http://www.mysite.com/index.php/section ... Alias.html ?

i mean the only difference with a mod_rewrite enabled SEF facility would be the "index.php" inserted but the end of the url would look the same

thx for any hint
Gregory

User avatar
zimmik
Joomla! Hero
Joomla! Hero
Posts: 2096
Joined: Thu Aug 18, 2005 12:57 pm
Location: Skanderborg, Denmark
Contact:

Re: Using SEF without mod_rewrite

Post by zimmik » Sun Aug 28, 2005 3:00 pm

Thax, just what i needed.
// Simon Milling Mikkelsen

Husk!: Google, og forummets søgefunktion er din ven!

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Mon Aug 29, 2005 7:52 am

Guardian wrote:
Websmurf wrote: this will enable SEF urls to work without mod_rewrite at all..
and create urls like this:
http://www.tim-online.nl/index.php/content/view/9/34/
http://www.tim-online.nl/index.php/content/view/10/35/
http://www.tim-online.nl/index.php/comp ... Itemid,78/
would it be possible to achieve something like:
http://www.mysite.com/index.php/section ... Alias.html ?

i mean the only difference with a mod_rewrite enabled SEF facility would be the "index.php" inserted but the end of the url would look the same

thx for any hint
Gregory

Yes, With the open source solutions, there should be a simular line in the files (components/com_sef/sef.php)

If you want to use sef advanced, you'll have to ask Emir to make the modification
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

Guardian
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu Aug 18, 2005 7:13 pm
Location: France

Re: Using SEF without mod_rewrite

Post by Guardian » Mon Aug 29, 2005 8:02 am

I tried 404SEF on another web account that has mod_rewrite enabled and it worked just fine.

I hope I'll succeed in using it without mod_rewrite performing the modification you described.

Gregory

User avatar
stuclark
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Aug 30, 2005 2:29 pm

Re: Using SEF without mod_rewrite

Post by stuclark » Tue Aug 30, 2005 8:44 pm

I've just been playing with this on my IIS server - it turns out that (so long as you've got index.php selected as a default document in IIS) you don't even need the index.php in the SEF'd URL.

However, you DO need the ? and I have found that you also need a trailing /

So, the complete URL produced would be http://www.domain.com/?/content/view/1/2/

This can be seen in action at http://www.sendosmartphones.com

Now my question is - would a search engine prefer .../?/... or .../index.php?/...

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Wed Aug 31, 2005 7:30 am

I don't know.

My preference would be /index.php?/
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
stuclark
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Aug 30, 2005 2:29 pm

Re: Using SEF without mod_rewrite

Post by stuclark » Wed Aug 31, 2005 8:37 am

Having played with this a little more - you need to use index?/ as otherwise things like SMF can't link to themselves properly.

Front-end editing is also borked - sef.php doesn't correctly identify those links as already having a /index.php? statement, so adds another. This results in broken URLs which look like .../index.php?/index.php?component=...

Seeing as sef breaks when I add the first few lines into sef.php - can anyone think of a way around this on IIS?

eosguy
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Aug 22, 2005 4:28 am
Location: Malaysia
Contact:

Re: Using SEF without mod_rewrite

Post by eosguy » Fri Sep 02, 2005 1:35 pm

Hi... I've done exactly what was detailed here, and the SEF worked on all pages except on 'projects' on my site: http://www.motion-ds.com/design/index.php

Any ideas why? Thanks for looking.


I'm not sure if it's appropriate to ask this question here - how do I improve my page ranking besides using SEF? My site is basically running 3 different site scripts, Mambo/Joomla!, phpBB and Gallery. So far keyword search in Altavista returned good results, while Google and Yahoo! returns nothing at all. :(
Last edited by eosguy on Sat Sep 03, 2005 7:31 am, edited 1 time in total.

eosguy
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Aug 22, 2005 4:28 am
Location: Malaysia
Contact:

Re: Using SEF without mod_rewrite

Post by eosguy » Sun Sep 04, 2005 5:19 am

Kindly ignore my previous post. I managed to get a proper link after changing the category/link.

drewg
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Tue Sep 13, 2005 8:39 am

Re: Using SEF without mod_rewrite

Post by drewg » Mon Sep 19, 2005 7:49 am

Hmm, great help, works for my main site, but maybe this is just me doing it wrong, I have an addon domain.. Anyway when trying to do it for the addon domain, I click on the link to my static content, and it goes there, but it just shows the homepage content.. Wierd, I'll add a seperate account for it and try, but yeh, a bit wierd.

User avatar
stingrey
Joomla! Hero
Joomla! Hero
Posts: 2756
Joined: Mon Aug 15, 2005 4:36 pm
Location: Marikina, Metro Manila, Philippines
Contact:

Re: Using SEF without mod_rewrite

Post by stingrey » Mon Sep 19, 2005 12:19 pm

Only stumbled upon this page now.


Very interesting to say the least
Rey Gigataras
http://www.wizmediateam.com <-- great team of talented Web Designers and Programmers!
http://about.me/reygigataras <-- About Me :)
Partner, Business Development & Project Manager, Event Manager, Sports Coach :D

User avatar
bluesaze
Joomla! Guru
Joomla! Guru
Posts: 750
Joined: Mon Sep 05, 2005 6:18 am
Location: India
Contact:

Re: Using SEF without mod_rewrite

Post by bluesaze » Mon Sep 19, 2005 2:23 pm

I had put in the wish list i guess you missed it ...... maybe we can have a inbuilt option for the windows users usign IIS
stingrey wrote: Very interesting to say the least
A. N. Jacob-New
The Tech & Design Blog http://www.Clazh.com

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Using SEF without mod_rewrite

Post by Websmurf » Mon Sep 19, 2005 2:26 pm

stingrey wrote: Only stumbled upon this page now.


Very interesting to say the least
it's been around for a while though :P

You could build it into mambo very easily. Some sort of mod_rewrite/basic check
Last edited by Websmurf on Mon Sep 19, 2005 2:28 pm, edited 1 time in total.
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
stingrey
Joomla! Hero
Joomla! Hero
Posts: 2756
Joined: Mon Aug 15, 2005 4:36 pm
Location: Marikina, Metro Manila, Philippines
Contact:

Re: Using SEF without mod_rewrite

Post by stingrey » Mon Sep 19, 2005 2:36 pm

Websmurf wrote: You could build it into mambo very easily. Some sort of mod_rewrite/basic check
Yes it does raise some interesting possibilities
Rey Gigataras
http://www.wizmediateam.com <-- great team of talented Web Designers and Programmers!
http://about.me/reygigataras <-- About Me :)
Partner, Business Development & Project Manager, Event Manager, Sports Coach :D

Thiago
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sat Sep 17, 2005 10:04 pm

Re: Using SEF without mod_rewrite

Post by Thiago » Tue Sep 20, 2005 5:14 pm

I just tried this on my website running on IIS, works great!

Thx,

Thiago
There are only two kinds of people in the end: those who say to God, 'Thy will be done,' and those to whom God says, in the end, 'Thy will be done.' C. S. Lewis


Locked

Return to “Open Source Products for Joomla!”