Page 1 of 1

Pretty URLs

Posted: Wed Aug 11, 2010 2:14 am
by jchelpdeskwv
Good evening all,
I would like to request assistance and feedback on an issue with pretty URLs.  The website is www.jeffersoncountywv.org.  Below are parts of config.php, htaccess file and modules installed.

The pretty URLs did work for about a month or so and I have not installed any new modules.
For example: www.jeffersoncountywv.org/gis-addressing.html used to resolve to the actual page but now goes to a 404 page.

I greatly appreciate the feedback.

--------------Config file section-----------------------------------------
#------------
#URL Settings
#------------

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';



-----------------------htaccess file section ----------------------------
# 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]

# Redirect departments & other
Redirect /government/departments/gis-addressing.html http://www.jeffersoncountywv.org/gis-addressing.html
Redirect /government/departments/emergency-communications.html http://www.jeffersoncountywv.org/emerge ... tions.html
Redirect /government/departments/capital-planning-and-management.html http://www.jeffersoncountywv.org/capita ... ement.html
Redirect /government/departments/engineering-department.html http://www.jeffersoncountywv.org/engine ... tment.html
Redirect /government/departments/homeland-security.html http://www.jeffersoncountywv.org/homeland-security.html
Redirect /government/departments/planning-and-zoning.html http://www.jeffersoncountywv.org/planni ... oning.html
Redirect /government/county-commission.html http://www.jeffersoncountywv.org/county-commission.html
Redirect /government/county-commission/agendas.html http://www.jeffersoncountywv.org/agendas.html
Redirect /government/county-commission/budget.html http://www.jeffersoncountywv.org/budget.html
Redirect /government/public-notices.html http://www.jeffersoncountywv.org/public-notices.html
Redirect /government/county-commission/press-releases.html http://www.jeffersoncountywv.org/press-releases.html
Redirect /living/careers.html http://www.jeffersoncountywv.org/careers.html
Redirect /business/doing-business.html http://www.jeffersoncountywv.org/doing-business.html
Redirect /government/departments/animal-control.html http://www.jeffersoncountywv.org/animal-control.html
Redirect /government/departments/planning-and-zoning/zoning/bza-agendas.html http://www.jeffersoncountywv.org/planni ... endas.html
Redirect /government/departments/planning-and-zoning/zoning/pc-agendas.html http://www.jeffersoncountywv.org/planni ... endas.html

Modules installed
Installed Modules:

CMSMailer: 2.0
FileManager: 1.0.2
MenuManager: 1.6.3
ModuleManager: 1.3.3
News: 2.10.5
nuSOAP: 1.0.1
Printing: 1.0.4
Search: 1.6.3
ThemeManager: 1.1.1
TinyMCE: 2.7.0
CTLModuleMaker: 1.8.9.3
CGExtensions: 1.18.8
RSS: 1.1
SiteMapMadeSimple: 1.2.1
CGExtensions: 1.18.8
XContent: initial release - BETA 3
Gallery: 1.3
Bookmarks: 2.0.1
Statistics: 1.0.1
Questions: 1.0.3
FormBuilder: 0.6.2
CGSimpleSmarty: 1.4.5
CGGoogleMaps: 1.4.1
phpids: 1.4.7
CGCalendar: 1.5.2
FrontEndUsers: 1.8.2
UserDirectory: 1.0-svn
ModuleXtender: 1.5.0
NFS: 1.0
Jobs: 1.0
mugshots: 1.0
CGFeedMaker: 1.0.11
IE6Warning: 1.03
News: 2.8.3

Re: Pretty URLs

Posted: Wed Aug 11, 2010 7:16 am
by Rolf
Hi JC,

I can't open the website at all...
You or your host did a serverchange?

Rolf  :)

Re: Pretty URLs

Posted: Wed Aug 11, 2010 11:29 am
by jchelpdeskwv
Hi Rolf,

That was an example of why UPS are important and something I will have to point out to my supervisors.  We had a power outage and the webserver stayed down.

The site is up now.  Thank you.

Re: Pretty URLs

Posted: Wed Aug 11, 2010 11:53 am
by spike
Pretty URL's seem to function fine -
for instance this link appears to work:
http://www.jeffersoncountywv.org/govern ... ing-2.html
have you moved pages? deleted pages ? duplicated pages etc. the very fact that a page exists by the name of gis-addressing-2.html indicates that the original page got duplicated. so what happened to gis-addressing.html and gis-addressing-1.html, they don't seem to exist anymore, or are deactivated . . .  - you would seem to have a link problem somewhere.
your pretty URL's are working fine as far as I can see
gruss - spike

Re: Pretty URLs

Posted: Wed Aug 11, 2010 12:28 pm
by jchelpdeskwv
Thank you spike for your reply.

The link http://www.jeffersoncountywv.org/govern ... ing-2.html is the direct link.  I had successfully used a redirect to shorten the URLs so that departments could put them on business cards.  For example: http://www.jeffersoncountywv.org/gis-addressing.html should go to http://www.jeffersoncountywv.org/govern ... ing-2.html but it goes to a 404 page. 

Re: Pretty URLs

Posted: Wed Aug 11, 2010 12:56 pm
by Rolf
For redirecting webpages with pretty url you can't use 'redirect' in the .htaccess

Try something like:

Code: Select all

RewriteRule ^some-old-page-alias.html$ http://www.your-web-domain.org/another-page-alias.html [R=301,L]
grtz. Rolf  :)

Re: Pretty URLs

Posted: Wed Aug 11, 2010 1:42 pm
by spike
excuse my ignorance but
shouldn't changing the name of - gis-addressing-2.html to gis-addressing.html in fact solve the problem without the necessity of any redirects.
Seems to me another case and yet another reason in favour of flat URL's