Jump to content


Friendly URLs in Subdomain


12 replies to this topic

#1 TimL

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 28 August 2009 - 05:33 PM

I've copied a client's site on to my own server to do some more development, and, while the Etomite manager works and I can view the home page in Firefox, any attempt to follow links from the home page gives a 404 error (File not found) on index.php (with no parameters). I can view the other pages using by typing <subdomain>/index?id=xx, so the pages definitely exist. The site is installed in a subdomain which I gather from reading topics on this forum may be a problem. However we did have this site working correctly in a subdomain on the same server when we did the original development a couple of years ago.

At my hosting provider's suggestion I've added a couple of lines to .htaccess so it now looks like this:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Any ideas on what might be going wrong would be very welcome.

-- Tim L

#2 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 29 August 2009 - 02:59 AM

Any chance that this is a FURL's issue in the Etomite configuration panel...???

#3 TimL

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 29 August 2009 - 08:56 AM

View PostRalph, on 29 August 2009 - 02:59 AM, said:

Any chance that this is a FURL's issue in the Etomite configuration panel...???
I don't think so. These are the settings I've got:

Use friendly URLs:        Yes
Prefix for friendly URLs: <blank>    
Suffix for friendly URLs: .html    
Friendly aliases:         Yes

If I've got it wrong, please let me know.

-- Tim L

#4 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 29 August 2009 - 01:41 PM

Let's try this again... Goto Etomite manager > Configuration > Friendly URL Settings > Use friendly URLs and turn FURL's off by selecting No... It would also be helpful to know the server specifications for your development server...

Server OS
Server software (Apache, IIS, Other)
PHP version
MySQL version

#5 TimL

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 29 August 2009 - 07:17 PM

Thanks, Ralph, your help is much appreciated.

View PostRalph, on 29 August 2009 - 01:41 PM, said:

Let's try this again... Goto Etomite manager > Configuration > Friendly URL Settings > Use friendly URLs and turn FURL's off by selecting No...
Done. All the links are coded with <alias>.html, so - as you would expect - when I try to follow them I get a 404 error with the message "The requested URL /home/virtual/site162/fst/var/subdomain/brucelance/html/index.php was not found on this server." I can still access sub pages by typing for example <my subdomain>/index.php?id=69 in my browser address bar.

Quote

It would also be helpful to know the server specifications for your development server...

Here they are:

Server OS                                            Linux
Server software (Apache, IIS, Other)                 Apache
PHP version                                          5.2.9
MySQL version                                        5.1.30

-- Tim L

#6 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 30 August 2009 - 02:49 PM

Ok... Sounds like there is a fundamental flaw in whatever menu snippet you are attempting to use... You should not be forcing Etomite to use a specific URL method... It is much better practice to let Etomite make that decision dynamically by using $etomite->makeUrl() because it will return the proper URL depending on current settings and capabilities... If an alias is available, and FURL's are enabled, it will return a FURL... If FURL's are turned off, or there is no alias, the proper URL will be returned... makeURl() will either return something like index.php?id=xxx or xxx.html or alias.html as it deems suitable... Not taking adantage of this feature is most likely the reason for the problems you are encountering...

What menu snippet are you using...??? Feel free to PM me or post a copy of it here if you'd like some further assistance with the code...

#7 TimL

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 30 August 2009 - 06:51 PM

Ralph

Thanks. I take your point about it being preferable to use makeURI(), but this is a copy of a live site which has worked (and is still working) perfectly well for a couple of years on another server and also worked correctly on the development server when we first built it. I'll PM you with a couple of URLs.

The menus are in chunks and we have a snippet which calls a different chunk depending depending on which section of the site you're in. The reason I'm loading the site back on to the development server is that we're doing a complete redesign, so we may do it differently this time!

When I uploaded the site to the development server, I just uploaded all the files, adjusted config.inc.php, checked the usual permissions, and imported a copy of the database. Should I have run Etomite install.php before importing the database?

-- Tim L

#8 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 30 August 2009 - 08:55 PM

I replied to your PM prior to reading your post...

If the site is rendering at all then the database has been migrated properly... We still need to know development server specifics... Your server may not be able to handle FURL's at all, otherwise the included .htaccess file should be sufficient... Etomite can't re-process hard coded FURL's back into non-FURL links... If the following .htaccess doesn't work then you either have an Etomite configuration issue or a server configuration issue...

# URL rewriting for Etomite CMS
# Last Modified: 2006-03-30 by Ralph Dahlgren
#
# You must be running on Apache mod_rewrite to use this.
# Remember, you must rename this file to .htaccess
#
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

The error below would leave me to believe that either you've changed the .htaccess file or that the server isn't properly configured because when I checked your site the FURL's were pointing to the correct locations...


Not Found
The requested URL <SNIP>/subdomain/<OBFUSCATED>/html/index.php was not found on this server.

EDIT: I just now saw your development server spec's posted above...

#9 TimL

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 30 August 2009 - 09:22 PM

You asked for server specifics. Do you need to know more than the following?

Server OS                                            Linux
Server software (Apache, IIS, Other)                 Apache
PHP version                                          5.2.9
MySQL version                                        5.1.30

I had a long exchange with the support desk of my hosting provider before opening this thread, and they suggested a couple of changes to .htaccess which I posted in my opening message here.

I'm going to try doing a clean install of Etomite on the development server, and see if that works with FURLs. If it does, we can live with that - it's not essential that I have a copy of the existing live site, as we're doing a complete redesign. I'll let you know how it goes.

-- Tim L

#10 TimL

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 01 September 2009 - 09:21 PM

Ralph

As I've also told you by PM, I've resolved this by accessing the Etomite site as a subdirectory, rather than as a subdomain.

Thanks for all your help.

-- Tim L

#11 GWillikers

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 21 September 2009 - 03:02 AM

View PostRalph, on 30 August 2009 - 08:55 PM, said:

I replied to your PM prior to reading your post...

If the site is rendering at all then the database has been migrated properly... We still need to know development server specifics... Your server may not be able to handle FURL's at all, otherwise the included .htaccess file should be sufficient... Etomite can't re-process hard coded FURL's back into non-FURL links... If the following .htaccess doesn't work then you either have an Etomite configuration issue or a server configuration issue...

# URL rewriting for Etomite CMS
# Last Modified: 2006-03-30 by Ralph Dahlgren
#
# You must be running on Apache mod_rewrite to use this.
# Remember, you must rename this file to .htaccess
#
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

The error below would leave me to believe that either you've changed the .htaccess file or that the server isn't properly configured because when I checked your site the FURL's were pointing to the correct locations...


Not Found
The requested URL <SNIP>/subdomain/<OBFUSCATED>/html/index.php was not found on this server.

EDIT: I just now saw your development server spec's posted above...
Greetings,
I'm having a similar (same?) problem with mod_rewrite || FURLs.
FYI:
server(s) Apache 1.CURRENT && Apache 2.CURRENT
PHP4-CURRENT && PHP5-CURRENT
directory options - Allow_override:All
mod_rewwrite block:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Etomite location: subdirectory
In the manager, FURL settings are:
prefix: page
suffix: .html
Friendly aliases: Yes
All of this results in all pages being unreachable (404).
Is this the intended outcome. ;)
For example; the home page becomes pageindex.html

Thank you for all your time and consideration in this matter.

--GW

#12 GWillikers

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 21 September 2009 - 03:59 AM

View PostGWillikers, on 21 September 2009 - 03:02 AM, said:

Greetings,
I'm having a similar (same?) problem with mod_rewrite || FURLs.
FYI:
server(s) Apache 1.CURRENT && Apache 2.CURRENT
PHP4-CURRENT && PHP5-CURRENT
directory options - Allow_override:All
mod_rewwrite block:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Etomite location: subdirectory
In the manager, FURL settings are:
prefix: page
suffix: .html
Friendly aliases: Yes
All of this results in all pages being unreachable (404).
Is this the intended outcome. ;)
For example; the home page becomes pageindex.html

Thank you for all your time and consideration in this matter.

--GW

OK I was able to solve it myself

Quote

NOTE TO MODERATOR:
You might want to provide a working example for those
running etomite out of a subdirectory in the .htaccess file provided with the install - I see others
have reported the same difficulties here in the forums.
My resolution was to use the following as my .htaccess file:
RewriteEngine On

RewriteRule ^$ index.php [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule (.*) index.php?q=$1 [QSA,L] 
RewriteRule ^(.*).html$ index.php
Keeping the same options noted above in the FURL manager section of etomite.

HTH

--GW

#13 Boni2k

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 09 February 2010 - 07:20 PM

Just wanted to share my findings:

My site's installed at www.jackpot-music.de/boni . As it's a subdirectory I had to change the .htaccess file like this:
RewriteEngine On

RewriteBase /boni

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

My prefix is .html. I guess RewriteBase did the trick. Thanks to mikef for that hint.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users