pretty urls problem / redirection to subdirectory
pretty urls problem / redirection to subdirectory
hi there,
i have already read a lot of forum entries about this topic but they all could not help my with my problem.
the thing is my installation of cms made simple is in a subdirectory www.website.xy/cmsmadesimple/. until now, i placed a index.html file in my root folder with a redirect. since this is not a nice solution, i wanted to change this workaround by redirecting with htaccess to the subdirectory by following the instructions on changing the config.php and putting a htaccess file in the root respectively the subdirectory. this did not work.
since the path to the website shown in the browser is something like
http://some.servername.net/website/cmsmadesimple, i wonder what is going on here; i don't have access to the directory "some", nor "servername" which seem to contain my actual site.
could this be the reason for the not working redirection and config settings?
another thing: in the config file, there is written
$config['root_url'] = 'http://some.servername.net/website/cmsmadesimple';
and
$config['root_path'] = '/home/httpd/docs/website/cmsmadesimple';
maybe i should change the address of the root url? and if yes, in which way?
thank you in advance for your help!
i have already read a lot of forum entries about this topic but they all could not help my with my problem.
the thing is my installation of cms made simple is in a subdirectory www.website.xy/cmsmadesimple/. until now, i placed a index.html file in my root folder with a redirect. since this is not a nice solution, i wanted to change this workaround by redirecting with htaccess to the subdirectory by following the instructions on changing the config.php and putting a htaccess file in the root respectively the subdirectory. this did not work.
since the path to the website shown in the browser is something like
http://some.servername.net/website/cmsmadesimple, i wonder what is going on here; i don't have access to the directory "some", nor "servername" which seem to contain my actual site.
could this be the reason for the not working redirection and config settings?
another thing: in the config file, there is written
$config['root_url'] = 'http://some.servername.net/website/cmsmadesimple';
and
$config['root_path'] = '/home/httpd/docs/website/cmsmadesimple';
maybe i should change the address of the root url? and if yes, in which way?
thank you in advance for your help!
Re: pretty urls problem / redirection to subdirectory
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: pretty urls problem / redirection to subdirectory
thank you rolf,
the first part of my problem seems to be solved by placing the following code in the htaccess file:
the index.php in the subdirectory is displayed and in the browser the url shows a pretty website.xy .
but still, when i want to click through the pages of the website,a 404 error is returned - the requested URL /website/cmsmadesimple/pagename is not found on this server (the browser shows the following url: http://some.servername.net/website/cmsm ... e/pagename)
the first part of my problem seems to be solved by placing the following code in the htaccess file:
Code: Select all
# redirect to www-directory and hide the /www in the URL
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule !^cmsmadesimple(/?|/.+)$ /cmsmadesimple%{REQUEST_URI} [L]
but still, when i want to click through the pages of the website,a 404 error is returned - the requested URL /website/cmsmadesimple/pagename is not found on this server (the browser shows the following url: http://some.servername.net/website/cmsm ... e/pagename)
Re: pretty urls problem / redirection to subdirectory
If you are using a subfolder for the site and want pretty URLs, even if it is a subdomain.domain.com set up, you need to use the rewritebase thingy in your htaccess...
RewriteBase /THE NAME OF THE SUBFOLDER
RewriteBase /THE NAME OF THE SUBFOLDER
Re: pretty urls problem / redirection to subdirectory
Thanks Dr. CSS,
i already set the .htacces the way you described:
but this did not work the way i supposed it should.
or did you mean like this:
i already set the .htacces the way you described:
Code: Select all
RewriteBase /cmsmadesimple
or did you mean like this:
Code: Select all
RewriteBase /some.servername.net/website/cmsmadesimple
Re: pretty urls problem / redirection to subdirectory
most likely:
Code: Select all
RewriteBase /website/cmsmadesimple
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: pretty urls problem / redirection to subdirectory
jo morg,
thank you for your advice, but changing the rewritebase that way does not change the website behaviour.
i still get 404 and
thank you for your advice, but changing the rewritebase that way does not change the website behaviour.
i still get 404 and
the url shown in the browser is http://some.servername.net/website/cmsm ... /post_slugThe requested URL /website/cmsmadesimple/post_slug was not found on this server.
Re: pretty urls problem / redirection to subdirectory
I have my website in a subfolder named www which contains my CMSMS website.
In the root folder I have a .htaccess file containing:
In the subfolder I use the regular (unchanged) CMSMS .htaccess file.
In the config.php file I have the settings for a regular setup with pretty urls
In the root folder I have a .htaccess file containing:
Code: Select all
#
RewriteEngine On
RewriteBase /www
# redirect to www-directory and hide the /www in the URL
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule !^www(/?|/.+)$ /www%{REQUEST_URI} [L]
In the config.php file I have the settings for a regular setup with pretty urls
Code: Select all
$config['root_url'] = 'http://www.website.com';
$config['url_rewriting'] = 'mod_rewrite';
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: pretty urls problem / redirection to subdirectory
@spundfix: As usual this is a typical case of lack if information from your part. All the solutions given on this topic work and have been tested, but we are only trying to guess what it is that you want to do. Please take the time to read this and elaborate on what it is that you expect to accomplish. Your 1st post is confusing at best imNSHo. There is no "one solution fits all"...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: pretty urls problem / redirection to subdirectory
It sounds like you have a subdomain, which is a subfolder, with a subfolder inside a subfolder which has CMSMS installed in it...
IMHO you're not going to get pretty URLs working...
Would you mind telling me why you have it buried so deep in your server..?
IMHO you're not going to get pretty URLs working...
Would you mind telling me why you have it buried so deep in your server..?
Re: pretty urls problem / redirection to subdirectory
dear Dr. CSS,
good question - i will have to ask my provider why he has buried my domain deeply, deeply down in his server dungeons.
dear Jo Morg,
you are right - i did not list my system informations. here they are:
CMS Made Simple 1.12, PHP 5.4.25, MySQL 5.0.37,
working with apache/2.0.59easytecc/2.0 (unix) dav/2 php/5.4.25 mod_perl/2.0.3 perl/v5.8.5,
running on linux 2.6.16duke12-host an i686.
but i doubt this information is the key to solving my problem. i rather think it is the strange server system which placed my domain in a subfolder of a subfolder or so.
whatever the reason is, i appreciate every effort to help. thank you already!
good question - i will have to ask my provider why he has buried my domain deeply, deeply down in his server dungeons.

dear Jo Morg,
you are right - i did not list my system informations. here they are:
CMS Made Simple 1.12, PHP 5.4.25, MySQL 5.0.37,
working with apache/2.0.59easytecc/2.0 (unix) dav/2 php/5.4.25 mod_perl/2.0.3 perl/v5.8.5,
running on linux 2.6.16duke12-host an i686.
but i doubt this information is the key to solving my problem. i rather think it is the strange server system which placed my domain in a subfolder of a subfolder or so.
whatever the reason is, i appreciate every effort to help. thank you already!
Re: pretty urls problem / redirection to subdirectory
Jo Morg wrote: Please take the time to read this and elaborate on what it is that you expect to accomplish. Your 1st post is confusing at best imNSHo.
Ok, be it as it may, I'm still not sure of what it is that you are trying to accomplish...spundfix wrote:but i doubt this information is the key to solving my problem. i rather think it is the strange server system which placed my domain in a subfolder of a subfolder or so.
- you did not specify if you want to have the url like:
- http://some.servername.net/website/cmsmadesimple/pagename.html (or similar);
- http://some.servername.net/pagename.html (or similar);
- you did not specify if you have different .htaccess files
on each of the folders and what is the content of each if any; - Only now we know that you have CMSMS 1.12, but was it an upgrade?
- if it was the $config['root_path'] is not needed anymore (unless you have the Cataloger module installed which is something you didn't inform us about either: modules list etc, etc...);
- also in that case $config['root_url'] may or may not be needed, depending on what you are trying to do... (for instance if you are trying to accomplish the same as RolfTJ, then it is needed...);
- is it the main domain or a sub domain? (you mention some.servername.net at some point as you mention http://www.website.xy another...);
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: pretty urls problem / redirection to subdirectory
thank you jo morg for your patient listing of points lacking my problem description.
here are the details that might help you for getting behind my problem:
i want to have the url like: http://website/pagename.html (or similar);
i tried the following .htaccess file in http://some.servername.net/website/ and in http://some.servername.net/website/cmsmadesimple/
i have upgraded to CMSMS 1.12.
installed modules:
CMSMailer 5.2.2, FileManager 1.4.5, MenuManager 1.8.6, ModuleManager 1.5.8, News 2.15.1, Printing 1.1.2, Search 1.7.12, ThemeManager 1.1.8, TinyMCE 2.9.12, Archiver 0.2.6, CMSPrinting 1.0.5, MicroTiny 1.2.9
main domain or a sub domain?
until recently, i thought my website.xy was the main domain. recently i found out, that obviously this is not the case. my domain website.xy seems to be the subdomain of http://some.servername.net.
that's why i wanted to create a redirect which lets the common user get the impression that website.xy is a main domain, so that for example posting a link from my website to Facebook does not look like http://some.servername.net/website/cmsmadesimple/pagename.html, but http://www.website.xy/pagename.html.
here are the details that might help you for getting behind my problem:
i want to have the url like: http://website/pagename.html (or similar);
i tried the following .htaccess file in http://some.servername.net/website/ and in http://some.servername.net/website/cmsmadesimple/
Code: Select all
# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"
#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
# This is important, so uncomment if your host permit
#Options -Indexes
#ServerSignature Off
#php_value session.cookie_httponly true
#Options +FollowSymLinks
# To prevent E_STRICT problems with PHP 5.3+ you can uncomment the following lines
# Note: These settings should only be enabled for production sites!
#php_flag display_startup_errors 0
#php_flag display_errors 0
#php_flag html_errors 0
#php_value docref_root 0
#php_value docref_ext 0
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /website/cmsmadesimple
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteCond %{REQUEST_METHOD} !POST$
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>
<IfModule mod_headers.c>
# Disable ETags
Header unset ETag
FileEtag None
# For Security
Header set X-Frame-Options "SAMEORIGIN"
</IfModule>
<IfModule mod_deflate.c>
# Compress css, plaintext, xml, gif, and images in transport.
AddOutputFilterByType DEFLATE text/css text/plain text/xml image/gif image/jpeg image/png
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
# Set expires tags on various file types... so that the browser wont attempt to reload them.
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/ico "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType video/x-flv "access plus 1 year"
ExpiresByType application/pdf "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access plus 1 year"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
<IfModule mod_headers.c>
# Setting cache control to public allows proxy servers to cache the items too.
Header set Cache-Control "public"
</IfModule>
</IfModule>
i have upgraded to CMSMS 1.12.
installed modules:
CMSMailer 5.2.2, FileManager 1.4.5, MenuManager 1.8.6, ModuleManager 1.5.8, News 2.15.1, Printing 1.1.2, Search 1.7.12, ThemeManager 1.1.8, TinyMCE 2.9.12, Archiver 0.2.6, CMSPrinting 1.0.5, MicroTiny 1.2.9
main domain or a sub domain?
until recently, i thought my website.xy was the main domain. recently i found out, that obviously this is not the case. my domain website.xy seems to be the subdomain of http://some.servername.net.
that's why i wanted to create a redirect which lets the common user get the impression that website.xy is a main domain, so that for example posting a link from my website to Facebook does not look like http://some.servername.net/website/cmsmadesimple/pagename.html, but http://www.website.xy/pagename.html.
Re: pretty urls problem / redirection to subdirectory
This makes no sense at all. DNS has the following structure: the TLD (Top Level Domain) usually com or org or by country etc, the main label (which we usually call the main domain but is the hosting domain) which is what you typically register and under which (depending on the contract you have with your hosting company) you can have from none to an unlimited number of sub-domains. These can go (down the hierarchy and from right to left from the higher level to the lower level) up to 127 levels.(*)spundfix wrote:main domain or a sub domain?
until recently, i thought my website.xy was the main domain. recently i found out, that obviously this is not the case. my domain website.xy seems to be the subdomain of http://some.servername.net.
So a domain would be: domain-name.tld...
A sub-domain of the previous domain would be: sub.domain-name.tld...
And you can find: sub3.sub2.sub1.domain-name.tld... etc...
So I'd recommend either moving the site to the root of the domain, or follow RolfTJ's link and implement his solution. But you need to understand what you are doing otherwise it wont work...
(*) http://en.wikipedia.org/wiki/Domain_Name_System
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: pretty urls problem / redirection to subdirectory
If you didn't set this up as a subdomain but just bought hosting it sounds like it's hosted on a subdomain that lets you have websites in subfolders...
Do they have any others hosted like this?
Either ask them how to get just your domain hosted or look for a different host...
Do they have any others hosted like this?
Either ask them how to get just your domain hosted or look for a different host...