[SOLVED] Pretty URLs not working
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
[SOLVED] Pretty URLs not working
My server is a Debian GNU/Linux operating system.
I followed the instructions at
http://docs.cmsmadesimple.org/configuration/pretty-url
After doing the steps, the homepage will load, then when I click onto another page (like mysite.com/index.php/about) it takes me to an error page saying
The requested URL index.php/about was not found on this server.
I've never flirted with Pretty URLs before so have pretty limited knowledge of working with them in CMSMS
I followed the instructions at
http://docs.cmsmadesimple.org/configuration/pretty-url
After doing the steps, the homepage will load, then when I click onto another page (like mysite.com/index.php/about) it takes me to an error page saying
The requested URL index.php/about was not found on this server.
I've never flirted with Pretty URLs before so have pretty limited knowledge of working with them in CMSMS
Last edited by michaywood on Mon May 19, 2014 3:21 pm, edited 3 times in total.
Re: Pretty URLs not working
A few possible causes:
- mod_rewrite is not available/enabled on your web server
- you did NOT copy htaccess.txt from /docs directory but copied .htaccess
- you did copy the right file but forgot to rename it to .htaccess
- ...
- mod_rewrite is not available/enabled on your web server
- you did NOT copy htaccess.txt from /docs directory but copied .htaccess
- you did copy the right file but forgot to rename it to .htaccess
- ...
Re: Pretty URLs not working
Also, if you are running CMSMS on a sub-folder of the domain you will need to set RewriteBase accordingly on this bit:
Assuming that the sub-folder is cmsms, change to:
PS: I just noticed
Code: Select all
#Sub-dir e.g: /cmsms
RewriteBase /
Code: Select all
#Sub-dir e.g: /cmsms
RewriteBase /cmsms
Do you mean that you have: $config['url_rewriting'] = 'internal';?... when I click onto another page (like mysite.com/index.php/about) it takes me to an error page saying
"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!
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
[SOLVED] Re: Pretty URLs not working
thanks for the input! I had done the .htaccess and config.php changes correctly, but assumed since .htaccess was in my sub-folder mysite.com/myfolder that it wouldn't need the subdir rewrite base. Once I changed that in the .htaccess to /myfolder, it worked! Thanks again, y'all!
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
Re: Pretty URLs not working
This fixed my main issue with pretty url's, but now I'm noticing a secondary problem with children.
All parent pages links work, but any children links aren't working as it's trying to go to mysite.com/myfolder/parent/child and loads the page text, but there is no styling and is just content on a white background. However, if I manually go to mysite.com/myfolder/child, the page loads correctly.
Any ideas on how to get children nav links to work correctly with Pretty URLs?
All parent pages links work, but any children links aren't working as it's trying to go to mysite.com/myfolder/parent/child and loads the page text, but there is no styling and is just content on a white background. However, if I manually go to mysite.com/myfolder/child, the page loads correctly.
Any ideas on how to get children nav links to work correctly with Pretty URLs?
Re: Pretty URLs not working
Please check if you have a {metadata} tag in the head section of your page template
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
Re: Pretty URLs not working
just double checked and there is a {metadata} in the <head> of my template.
not sure if it matters, but this CMSMS is under a folder mysite.com/myfolder
not sure if it matters, but this CMSMS is under a folder mysite.com/myfolder
Re: Pretty URLs not working
Posting a link might help to solve problem faster.
Posting page template can help too.
Posting page template can help too.
Re: Pretty URLs not working
Additionally check your source html (on your browser -> view source) for <base href="<some value here>" />. This should be present, and correctly reflect the url from the domain root up to your installation root for relative links. Shouldn't be a problem for absolute links.
"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!
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
Re: Pretty URLs not working
I added <base href="http://www.mysite.com/myfolder/" /> to my page template, cleared cache and tried and still the same issue.
Unfortunately the site isn't live yet, so the sitedown message is turned on so can't just post link to page, but below is all code in my page template up until the starting </__body> tag.
I'm using Zurb's Foundation 5 + TypeKit to build this, thus the reason for a few of the link/script tags above.
EDIT: not sure why it's adding those _ _ to my code, but those are not there in the code
Unfortunately the site isn't live yet, so the sitedown message is turned on so can't just post link to page, but below is all code in my page template up until the starting </__body> tag.
Code: Select all
{process_pagedata}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
{literal}<__script__ type="text/javascript" src="//use.typekit.net/tkr3ikq.js"></__script>
<__script__ type="text/javascript">try{Typekit.load();}catch(e){}</__script>{/literal}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/foundation.css" />
<link rel="stylesheet" href="css/mytouches.css" />
<__script__ src="js/vendor/modernizr.js"></__script>
<title>{sitename} - {title}</title>
{metadata}
{cms_stylesheet}
<base href="http://www.mysite.com/myfolder" />
</head>
EDIT: not sure why it's adding those _ _ to my code, but those are not there in the code
Re: Pretty URLs not working
Note that {metadata} should do this for you. I just asked if you could find it as you could have used {metadata showbase=false} preventing the tag to be rendered.michaywood wrote:I added <base href="http://www.mysite.com/myfolder/" /> to my page template, cleared cache and tried and still the same issue.
"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!
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
Re: Pretty URLs not working
i don't see a base href in my page source, but I simply have the {metadata} tag with no other info inside it, like showbase=false.
Re: Pretty URLs not working
Code: Select all
<link rel="stylesheet" href="{root_url}/css/foundation.css" />
<link rel="stylesheet" href="{root_url}/css/mytouches.css" />
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
[SOLVED] Re: Pretty URLs not working
boom. problem solved. Thanks!
adding {root_url} to my header did the trick
adding {root_url} to my header did the trick