Jump to content


Friendly URL's 0.6.x (Apache)


  • You cannot reply to this topic
226 replies to this topic

#186 Bacteria Man

    Etomite Forum Fan

  • Member
  • Pip
  • 53 posts

Posted 12 March 2006 - 07:46 AM

Dean, on Mar 11 2006, 05:04 PM, said:

I had to do the exact same thing a couple of days ago on a new server...

Hmmph. My system is new as well. It must be something subtle with Apache 2.

Oh well. It works just the same with no apparent security risk.

I should add that it's best to set "AllowOverride All" for a specific directory (versus globally) in httpd.conf (assuming you have access.) For example:

<Directory "var/www/html/etomite">
  AllowOverride All
</Directory>

Edited by Bacteria Man, 12 March 2006 - 09:00 PM.


#187 jsellmann

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 01 June 2006 - 08:46 AM

Friendly URL's are working with Apache 2 on Windows (Win98 and WinXP).

My Configuration:

Apache/2.0.55 (Win32)
PHP Version 5.1.2 (Win98) / 5.1.4 (WinXP)
etomite 0.6.1-final


For etomite it was configured in the http.conf:

# 
# CMS 
# 
Alias /cms "D:/Server/etomite/" 
<Directory "D:/Server/etomite/"> 
Options Indexes FollowSymLinks 
AllowOverride All
Order allow,deny 
Allow from all 
</Directory>

The etomite-folder is parallel to the document root.

The .htaccess for etomite is as following:

RewriteEngine On
Options +FollowSymLinks
RewriteBase /cms/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

The most important thing is the RewriteBase.
It only works with /cms/, the name of the alias.
Without this line it doesn't work.

The .htaccess for etomite-manager is the default one:

RewriteEngine Off

php_value session.cookie_lifetime 483840
php_value session.gc_maxlifetime 483840
php_value upload_max_filesize 8388608


:)

#188 mjw

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 10 October 2006 - 09:22 PM

Virtual host on Apache2/rhel4 (ClarkConnect 4.0)...

<VirtualHost *:80>
		ServerName www.mydomain.com
		ServerAlias www.mydomain.com
		DocumentRoot /var/www/virtual/www.mydomain.com

		<Directory "/var/www/virtual/www.mydomain.com">
				RewriteEngine On
				RewriteCond %{REQUEST_FILENAME} !-f
				RewriteCond %{REQUEST_FILENAME} !-d
				RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
		</Directory>

		<Directory "/var/www/virtual/www.mydomain.com/manager">
				RewriteEngine Off
		</Directory>

</VirtualHost>

..and no need to use the .htaccess files.

PS. Don't forget to restart httpd! HTH

#189 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 10 October 2006 - 09:24 PM

Whilst it is a good alternative, not everyone has access to the files needed to be modified :(

#190 mjw

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 10 October 2006 - 10:08 PM

View PostDean, on Oct 10 2006, 10:24 PM, said:

Whilst it is a good alternative, not everyone has access to the files needed to be modified :(
This is true. Unfortunately, the only other alternative that worked with my configuration still requires access to either /etc/httpd/conf/httpd.conf or /etc/httpd/conf.d/www.mydomain.com.vhost, e.g.:

<Directory "/var/www/virtual/www.mydomain.com">
	Options Indexes FollowSymLinks
	AllowOverride All
	Order allow,deny
	Allow from all
</Directory>

In this example, both .htaccess files (without change) are required.

I noticed when reading through this thread that a few people (including me) were getting a 404 error and nothing in the error log. This seemed to suggest that the .htaccess file was not enabled (which was the case.)

#191 kiviniar

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 05 December 2006 - 07:04 PM

I dont know what i did but the SE friendly urls just started working on my site...hehehehe :rolleyes:

Feeling bad thought, just gave my poor host a piece of my mind :(


Anyways. now i am happy :D

#192 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 05 December 2006 - 08:54 PM

View Postkiviniar, on Dec 5 2006, 02:04 PM, said:

Feeling bad thought, just gave my poor host a piece of my mind :(
That piece of your mind must have been motivation enough for your host to get things straightened around so that FURL's now work... B) No need in feeling bad about progress... :eto:

#193 Bjarne

    Etomite Forum Fan

  • Member
  • Pip
  • 94 posts

Posted 02 March 2007 - 12:15 AM

I have now struggled for hours to get FURLs to work in a new site, without luck. I have set up Etomite a number of times before, and it has allways worked like a charm. But no I have a new host to deal with, and things are not as easy anymore.

I have tried every trick suggested in this thread, but the result is the same no matter what I do. The links generated on the front page seems correct, with alias.html, but when i click it, I get a error 404, telling me that alias.html does not exist.

RewriteMod is installed an enabled
The .htaccess is there, and have been experimented with back and forth at least 50 times, with absolutely all suggestions in this thread.

On the 404 i get a message saying that "The link on the referring page seems to be wrong or outdated". The interessting part is that the link back to referring page is not index.php?id=138, but
index.php%3fid=138. It seems that some how the question mark turns into %3f. The link back to referring page doesn not work because of this.

The server is running Apache/2.0.49 (Linux/SuSE) with PHP 4.3.4. Register globals is set to off, but I have tried to set it on without any effect.

I have asked my host, but the hostmaster can't see any limitations in what I can do with .htaccess. Everything seems to be in order there. I am beginning to suspect a bug in the mod_rewrite.

A strange thing is that the site is working even if I turn of the FURL in Etomite. Normally the .htaccess will corrupt the whole site if it is present, but it is not. It seems like the .htaccess just is not there.

This is how it looks like right now:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Any suggestions will be highly appreciated.

#194 Ed Headset

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 194 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Etomite, PHP, Ajax.
    3D imaging

Posted 13 June 2007 - 01:22 PM

I have found the trick for IIS on windows.

You can use the FREE version of ISAPI_Rewrite.

In the documentention on this site the rewrite rule is not correct, but does work in the full version.

How to install:
Install the free (lite) version.
And create a file called httpd.ini file inside the folder where the dll file is.
Default installation folder : C:\Program Files\Helicon\ISAPI_Rewrite

Just replace any code is has with the folowing:
[ISAPI_Rewrite]
RewriteRule /(.*)\.html /index.php\?q=$1

Go to your configuration - > Friendly URL settings.

Select Use friendly URLs [YES]

Prefix for friendly URLs: [ YOU CAN ADD ANYTHING HERE ]

Suffix for friendly URLs: [.html]

Friendly aliases: [YES]

Page url will change the next time a page is loaded.
and will look something like: <siteurl>/<Prefix for friendly URLs><page alias or ID number>.html

:lol: :P

Edited by Ed Headset, 13 June 2007 - 07:56 PM.


#195 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 21 August 2007 - 11:10 PM

View PostEd Headset, on Jun 13 2007, 09:22 AM, said:

I have found the trick for IIS on windows.

You can use the FREE version of ISAPI_Rewrite.

In the documentention on this site the rewrite rule is not correct, but does work in the full version.

How to install:
Install the free (lite) version.
And create a file called httpd.ini file inside the folder where the dll file is.
Default installation folder : C:\Program Files\Helicon\ISAPI_Rewrite

Just replace any code is has with the folowing:
[ISAPI_Rewrite]
RewriteRule /(.*)\.html /index.php\?q=$1

Ed,
I am about ready to have to try this for the first time. I don't quite understand what you are referring to with the above code change, can you re-phrase that?

#196 Ed Headset

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 194 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Etomite, PHP, Ajax.
    3D imaging

Posted 26 August 2007 - 12:20 PM

View Postcathode, on Aug 22 2007, 01:10 AM, said:

Ed,
I am about ready to have to try this for the first time. I don't quite understand what you are referring to with the above code change, can you re-phrase that?

Apologies for a bit late response :blush:


There is documentation about friendly URL using ASIP_Rewrite Here

Quote

.........<snip>
2) You then add a file called httpd.ini at the root of your site and the contents of that file are as follows:

[ISAPI_Rewrite]
RewriteRule /(.*).html /index.php?q=$1
...........<snip>

This code fir the httpd.ini does work, but only for the payed version of ASPI_Rewrite.

If you are using the FREE version you have to use this code

[ISAPI_Rewrite]
RewriteRule /(.*)\.html /index.php\?q=$1
I have this in my httpd.ini inside the default folder where ASPI_ReWrite is installed.

To get things working you should enable the friendly url (obviously ;) )
And the prefix to .html

I have the following settings in Etomite manager:
Attached File  temp1.png   28.25K   11 downloads

This should work, but just one remark, this setting is for ALL the website you have running.
If you have more website you should add

RewriteCond Host: <prefix>\.<doman>\.<com/net/org,etc>
Place the code for your site under this line, and the code is only executed if the codition is met.

I hope that this explains a bit more what I was referring to :D

Good luck!

(edit: Typo's and spelling :blush: )

Edited by Ed Headset, 27 August 2007 - 01:00 PM.


#197 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 26 August 2007 - 11:15 PM

Ed,
That was a wonderful and detailed answer- worthy of going into the Etomite documentation :) Thank you!

#198 Ed Headset

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 194 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Etomite, PHP, Ajax.
    3D imaging

Posted 27 August 2007 - 12:54 PM

View Postcathode, on Aug 27 2007, 01:15 AM, said:

Ed,
That was a wonderful and detailed answer- worthy of going into the Etomite documentation :) Thank you!

Thanks ;)

Edited by Ed Headset, 27 August 2007 - 12:55 PM.


#199 schtief

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 29 August 2007 - 02:27 PM

I've created a mod to have a structure like:

home
item
-subitem1
-subitem2

and so on...

the pages are linked as:

/home.html
/item.html
/item/subitem1.html
/item/subitem2.html

and so on...

just look here: Friendly Url with Folders

not too much modding, but it's german :-)

EDIT
I tried to quick-translate the page an here's the result Friendly Url with Folders now in english
. I hope you understand my english

Edited by schtief, 30 August 2007 - 02:54 PM.


#200 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 29 August 2007 - 03:19 PM

Hi, translate to English please?

#201 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 29 August 2007 - 03:26 PM

View Postschtief, on Aug 29 2007, 10:27 AM, said:

I've created a mod to have a structure like:

home
item
-subitem1
-subitem2

and so on...

the pages are linked as:

/home.html
/item.html
/item/subitem1.html
/item/subitem2.html

and so on...

just look here: Friendly Url with Folders

not too much modding, but it's german :-)
That looks very promising...

#202 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 29 August 2007 - 04:28 PM

View Postschtief, on Aug 29 2007, 10:27 AM, said:

<<< SNIP >>>
I'm having problems with this mod... Whenever a page is rendered that is displayed as being in a subfolder I lose my page template formatting... It appears as though the parser isn't able to interpret the correct template to use for that specific page... Has anyone else who has tested this code experienced this problem...???

EDIT
I have found that the reason behind this behavior was due to my using relative paths to my stylesheets, images, and javascripts... Making the paths in my page template start from the doc root fixed that problem but there is still a problem with images that I am working on... Definitely not a Plug-N-Play solution...

#203 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 29 August 2007 - 04:38 PM

It'll be because the paths to the css are relative to the document you are viewing - you need to fix them?

so instead of ./style.css, it's http://www.yoururl.tld/style.css

#204 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 30 August 2007 - 01:16 PM

View PostDean, on Aug 29 2007, 12:38 PM, said:

It'll be because the paths to the css are relative to the document you are viewing - you need to fix them?

so instead of ./style.css, it's http://www.yoururl.tld/style.css
Right... I use assets/images/image.ext and templates/templatename/css/style.css as by default... I simply had to add a leading slash to force the path to start at the doc root... Just makes the code less portable considering how I move installs around on the server... I had more problems and had to revert to the original code for now... I'll give it another go as soon as I get a chance...

#205 schtief

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 30 August 2007 - 02:55 PM

I tried to quick-translate the page an here's the result Friendly Url with Folders now in english. I hope you understand my english





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users