Hi Mark,
Thanks for your answer. I tried Revo in the past and found that the learning curve was not worth for my needs.
The client will be myself and login twice is not a real problem as the two versions are like two distinct websites.
Yes, I opted for two separate installs.
The mobile version is in the "/m".
After some tests, I could find some settings that a priori seems working fine.
Here's the content of .htaccess for the main site on localhost.
The site in installed in xampplite/htdocs/domain.ext.
On the remote server, the RewriteBase path is changed to "/".
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /domain.ext/
#AllowOverride all
# Force “www.domain.ext” instead of just “domain.ext”
# To activate only for the remote site.
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^www\.domain\.ext [NC]
#RewriteRule (.*) http://www.domain.ext/$1 [R=301,L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [QSA,L]
Here's the content of .htaccess in the "/m" subfolder on localhost.
i.e. in xampplite/htdocs/domain.ext/m.
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /domain.ext/m/
#AllowOverride all
# Exclude /m /fonts /modeles /img /assets and /manager directories from rewrite rules
RewriteRule ^(m|fonts|modeles|img|manager|assets) - [L]
# The Friendly URLs part
RewriteCond %.{REQUEST_FILENAME} !-f
RewriteCond %.{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [QSA,L]
The important thing to note is that the names of all folders in which the sub-site picks ressources must be excluded from the rewrite.
RewriteRule ^(m|fonts|modeles|img|manager|assets) - [L]
That's done in the .htaccess that is located in the ".m" folder.
The line can also be put in the .htaccess file at the root of the main site, but this is optional.
I assume that by setting "on" the AllowOverride option, one could maybe put the RewriteRule that excludes folders only in the .htaccess of the main site; however, this has not been working for me, and the current solution suits me.
EDIT - Bug 05/23/2013
There is a bug in the .htaccess files posted above.
In the /m folder of the mobile site, are some stylesheets which should be loaded into the pages of the mobile site.
<base href="http://www.domain.ext/m/" />
<link rel="stylesheet" type="text/css" href="styles.css" />
Those stylesheets are not found, excepted if their name starts with a "m" character.
[ed. note: Jul last edited this post 13 years, 4 months ago.]