Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi

I am using couchcms in a website and am doing SEO on it and found in a post in the couchcms forum the following SEO tags and just seeing if these are ok or if is a better way to do it, in my header.php file in a folder called includes, I got the following between the <head></head> tags

Code: Select all
<title><cms:get_custom_field 'page_title' masterpage=k_template_name /></title>
<meta name="description" content="<cms:get_custom_field 'page_desc' masterpage=k_template_name />
<meta name="keywords" content="<cms:get_custom_field 'page_keywords' masterpage=k_template_name />


In my index.php file, I got the following code in between the <cms:template> and </cms:template>

Code: Select all
<cms:editable name='page_section_header' label='Homepage Meta/Head Details' type='group' />
<cms:editable name='page_title' type='text' label='Page Title' group='page_section_header' maxlength="180" desc='For SEO Please keep it 180 or less Characters'>Please enter the page title here</cms:editable>
<cms:editable name='page_desc' type='text' label='Page Description' group='page_section_header' maxlength="180" desc='For SEO Please keep it 180 or less Characters'>Please enter a short page description here</cms:editable>
<cms:editable name='page_keywords' type='text' label='Page Keywords' desc='Seperate key words with a comma' group='page_section_header' desc='For SEO Please keep it 10 keyword Phrases Seperated by Commas'>Please, enter, keywords, here, with, commas, separating, them</cms:editable>


Also in htaccess file I want to remove the .php extension in the url address bar but when I tried it, it made the couchcms not work as said it could not be found, is there a way to only exclude the .php from the main site files and exclude it from the couchcms folder on the server?

Thank you in advance

Ian
Hi Ian,

I am not a SEO expert so won't be able to comment on the efficacy of your code from SEO perspective. Perhaps our friends from this community would like to chip in.

As for removing the .php extension - have you tried using Couch's prettURLs?
http://www.couchcms.com/docs/concepts/pretty-urls.html

That, out-of-the-box, removes the php extension.
Hi KK

I found a solution to the .htaccess issue and the removal of .php from the main files and exclude the couchcms folder

The solution I found is below

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

## don't touch /forum URIs
RewriteRule ^couchcms/ - [L,NC]

## hide .php extension snippet

# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

# To internally forward /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]

Seems to have worked perfect
3 posts Page 1 of 1