Newbie looking for help with pretty urls
Newbie looking for help with pretty urls
Hi, this is my first install of CMSMS and everything has gone very smoothly up until I tried to create pretty urls. I've followed all the User Handbook directions for using mod rewrite for pretty urls, but when I go back and view my site, the links on my homepage have been updated to pretty urls (domain.com/parent/child.html), but if you click on any of the links you get a 404. I wasn't getting any 404's before I attempted the pretty urls.
Here's what I have in config.php:
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
I also copied the .htaccess file that was in the docs directory to the root level, and made sure my FTP settings were set as encoding: ASCII as specified in the User Handbook.
I looked for info from my host on mod rewrites b/c I thought maybe it has something to do with my server config, but it says this:
"Mod_rewrite is an Apache web server module installed on all of our Linux severs by default; it does not have to be installed or enabled. Our Linux hosting accounts support most mod_rewrite functionality.
You do not need to enable mod_rewrite in your httpd.conf, as this is handled at a global level. All you need to do is add the desired code to the body of your .htaccess file."
So since I'm a newbie at this, I'm kind of lost in terms of troubleshooting. Does anyone have any advice?
Linux/MySQL 4.1 if that helps.
Thanks for any advice.
Here's what I have in config.php:
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
I also copied the .htaccess file that was in the docs directory to the root level, and made sure my FTP settings were set as encoding: ASCII as specified in the User Handbook.
I looked for info from my host on mod rewrites b/c I thought maybe it has something to do with my server config, but it says this:
"Mod_rewrite is an Apache web server module installed on all of our Linux severs by default; it does not have to be installed or enabled. Our Linux hosting accounts support most mod_rewrite functionality.
You do not need to enable mod_rewrite in your httpd.conf, as this is handled at a global level. All you need to do is add the desired code to the body of your .htaccess file."
So since I'm a newbie at this, I'm kind of lost in terms of troubleshooting. Does anyone have any advice?
Linux/MySQL 4.1 if that helps.
Thanks for any advice.
Re: Newbie looking for help with pretty urls
Can you post your .htaccess file?
Have you cleared the cache in Admin?
Nullig
Have you cleared the cache in Admin?
Nullig
Re: Newbie looking for help with pretty urls
my .htacess is the defaul one that was in the docs directory, it looks like this:
#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On
#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
I went to my Admin Global settings and cleared cache, is that correct or is there another way to do it?
#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On
#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
I went to my Admin Global settings and cleared cache, is that correct or is there another way to do it?
Re: Newbie looking for help with pretty urls
I think it should be:
Nullig
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 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 [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+).html$ index.php?page=$1 [QSA]
Re: Newbie looking for help with pretty urls
hmmm...that didn't work either.
any other suggestions?

Re: Newbie looking for help with pretty urls
Is your installation in a subdirectory?
Can you post a link to the site?
Nullig
Can you post a link to the site?
Nullig
Re: Newbie looking for help with pretty urls
Installation is not in a subdirectory, here's the site: http://dogsassy.com/
You'll see when you roll over the links that the nice urls appear but all the links are broken. If I go back to config.php and set these values:
$config['assume_mod_rewrite'] = false;
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = false;
then the installation works fine and all the links work again.
thanks again.
You'll see when you roll over the links that the nice urls appear but all the links are broken. If I go back to config.php and set these values:
$config['assume_mod_rewrite'] = false;
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = false;
then the installation works fine and all the links work again.
thanks again.
Re: Newbie looking for help with pretty urls
Can you post your full .htaccess file, as it is now?
Nullig
Nullig
Re: Newbie looking for help with pretty urls
Sure, this is it:
#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 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 [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+).html$ index.php?page=$1 [QSA]
#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 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 [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+).html$ index.php?page=$1 [QSA]
Re: Newbie looking for help with pretty urls
Do you have the {metadata} tag in your template?
Are the paths correct in your config.php?
Nullig
Are the paths correct in your config.php?
Nullig
Re: Newbie looking for help with pretty urls
yes, {metadata} is in the template, I'm still using the default template that came with the CMSMS install (1.2.3 "Black Rock").
i think the paths are correct in config.php, do you have an example of what they should look like?
does something like this look right?
#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/home/content/e/s/t/adminname/html'
i think the paths are correct in config.php, do you have an example of what they should look like?
does something like this look right?
#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/home/content/e/s/t/adminname/html'
Re: Newbie looking for help with pretty urls
I just tried enabling internal pretty urls, instead of using mod rewrite, to see what would happen. So I updated config.php to:
$config['assume_mod_rewrite'] = false;
$config['internal_pretty_urls'] = true;
$config['use_hierarchy'] = true;
I cleared the admin cache again, and I haven't touched .htaccess since the last update.
With internal pretty urls enabled, I get the following error message when I click on any of my menu links:
"No input file specified."
Does that help identify the problem at all?
$config['assume_mod_rewrite'] = false;
$config['internal_pretty_urls'] = true;
$config['use_hierarchy'] = true;
I cleared the admin cache again, and I haven't touched .htaccess since the last update.
With internal pretty urls enabled, I get the following error message when I click on any of my menu links:
"No input file specified."
Does that help identify the problem at all?
Re: Newbie looking for help with pretty urls
I think you should check with your hosting company, to make sure that the .htaccess is being seen/implemented properly.
Nullig
Nullig