Pretty URLs
Pretty URLs
I tried to utilize Pretty URLs as described at http://docs.cmsmadesimple.org/configuration/pretty-url. However, there appears to be a problem with it and I may have gotten myself in too deep.
Basically, I have lost all access to one particular domain, as well as the admin access to CMSMS. Can't remember all the things I've tried to do to recover. Probably made it worse.
Here are a couple questions:
1. I just installed a fresh CMSMS for another domain, and that one has no .htaccess file in /home/mydomain/. Why should my other domain have one?
2. Step 2 states "Add to the bottom of your website's config.php:". As there may be more than one such file, is this the one in the root of the domain?
Thanks.
Basically, I have lost all access to one particular domain, as well as the admin access to CMSMS. Can't remember all the things I've tried to do to recover. Probably made it worse.
Here are a couple questions:
1. I just installed a fresh CMSMS for another domain, and that one has no .htaccess file in /home/mydomain/. Why should my other domain have one?
2. Step 2 states "Add to the bottom of your website's config.php:". As there may be more than one such file, is this the one in the root of the domain?
Thanks.
Re: Pretty URLs
You don't have to have an .htaccess file. Several sites I set up do perfectly well without one.1. I just installed a fresh CMSMS for another domain, and that one has no .htaccess file in /home/mydomain/. Why should my other domain have one?
But ... if you e.g. want to have pretty URLs, .htaccess is there to arrange that.
As far as I kow you only have one config.php file in your CMSMS installation and yes, that 's in the root.2. Step 2 states "Add to the bottom of your website's config.php:". As there may be more than one such file, is this the one in the root of the domain?
Frank
Re: Pretty URLs
So while other program installations may have them, such as /home/mydomain/public_html/limesurvey/application/config/config.php, CMSMS only has the one. That makes sense.
Why doesn't the same thing hold true for .htaccess? There are many scattered thru various directories under the CMSMS installation.
Thanks much.
Why doesn't the same thing hold true for .htaccess? There are many scattered thru various directories under the CMSMS installation.
Thanks much.
-
- Power Poster
- Posts: 1049
- Joined: Wed Mar 19, 2008 4:54 pm
Re: Pretty URLs
The htaccessfiles in the subdirectories are there because the htaccess in a subdirectory is taking precendence over the root htaccess
Re: Pretty URLs
Very short overview: https://en.wikipedia.org/wiki/Htaccess
"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
Thanks all. In fact I shouldn't have asked that last question. That was stupid of me. I had already read all about that and understood it.
I was more interested in the relationship of the two files when it comes to pretty URLs. I really don't see what they have to do with them.
I was more interested in the relationship of the two files when it comes to pretty URLs. I really don't see what they have to do with them.
-
- Power Poster
- Posts: 1049
- Joined: Wed Mar 19, 2008 4:54 pm
Re: Pretty URLs
Config.php tells your cms to use pretty url's.
Htaccess does the same on serverlevel.
Htaccess does the same on serverlevel.
Re: Pretty URLs
config.php tells cmsms to GENERATE pretty urls.
So all links in the menu, cms_selflink, canonical urls and maybe some other links modules generate.
However, cmsms will not understand those links. It needs something like
index.php?page=alias
That's where .htaccess comes in; it translates the pretty url a visitor/browser uses to something cmsms can understand.
So all links in the menu, cms_selflink, canonical urls and maybe some other links modules generate.
However, cmsms will not understand those links. It needs something like
index.php?page=alias
That's where .htaccess comes in; it translates the pretty url a visitor/browser uses to something cmsms can understand.
Re: Pretty URLs
Ah... okay. Let me see if I have this right:
1. So one must place the code:
at the end of the config.php file, located in the root of the domain, as in /home/mydomain/ (or is it /home/mydomain/public_html/?), and this will allow the Pretty URLs to be generated.
2. Then one must substitute the .htaccess found in the root of the domain (same location question as above) with the one found in /doc, as supplied by CMSMS named htaccess.txt, by copying it and renaming to overwrite existing one. This then makes it possible for the system to interpret the Pretty URLs created by the action in number 1 above.
What about the other .htaccess files found in other directories? They are there to control access to them; the other part of what .htaccess files do as I understand it. But don't they have to have the information added from htaccess.txt as well?
1. So one must place the code:
Code: Select all
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
2. Then one must substitute the .htaccess found in the root of the domain (same location question as above) with the one found in /doc, as supplied by CMSMS named htaccess.txt, by copying it and renaming to overwrite existing one. This then makes it possible for the system to interpret the Pretty URLs created by the action in number 1 above.
What about the other .htaccess files found in other directories? They are there to control access to them; the other part of what .htaccess files do as I understand it. But don't they have to have the information added from htaccess.txt as well?
Re: Pretty URLs
The path is most times /public_html where you unpack the CMSMS files, you should be able to find the admin folder there to make sure...
Yes, add those 2 lines to the config.php, then copy [root]/doc/ htaccess.txt into [root] and rename to .htaccess...
The other .htaccess files are only to limit access to those folder they are in and no they don't need any more code added to them...
Yes, add those 2 lines to the config.php, then copy [root]/doc/ htaccess.txt into [root] and rename to .htaccess...
The other .htaccess files are only to limit access to those folder they are in and no they don't need any more code added to them...
Re: Pretty URLs
Thanks, Doc, for verifying that for me. I thought I got it but was not sure.
What is the rule for knowing which .htaccess files should be edited and which do not need to be or should not be?
Thanks again.
What is the rule for knowing which .htaccess files should be edited and which do not need to be or should not be?
Thanks again.
Re: Pretty URLs
The only htaccess file you should touch is the one we already talked about...
Re: Pretty URLs
Thanks for the good rule of thumb. I will remember that.