Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

URL with .html


Reply


2 Posts   1083 Views

Avatar
snaip

Community Member, 180 Posts

10 May 2010 at 9:43pm

hi

i'm trying to change the url from /page to /page.html

using this solution
http://www.silverstripe.org/customising-the-cms/show/269222

RewriteRule ^/?$ sapphire/main.php?url=/&%{QUERY_STRING} [L]
RewriteRule ^((?:admin|dev|db|Security|images|api|soap|PageComment|processes)(?:/.+)?)$ sapphire/main.php?url=$1&%{QUERY_STRING} [L]
RewriteRule ^(.*)\.html$ sapphire/main.php?url=$1&%{QUERY_STRING} [L]

and than in template put %2Ehtml seems to work

<a href="$URLSegment%2Ehtml">$Title</a>

%2Ehtml = .html

but the problem is with editing HTML in CMS
HTML icon doesn't work now and i get error

Sorry, it seems you were trying to access a page that doesn't exist.

Please check the spelling of the URL you were trying to access and try again.
Visit www.silverstripe.com to download the CMS

Avatar
snaip

Community Member, 180 Posts

12 May 2010 at 9:00pm

Edited: 12/05/2010 10:08pm

probably the solution is to change

RewriteRule ^(.*)\.html$ sapphire/main.php?url=$1&%{QUERY_STRING} [L]

to

RewriteRule ^\.html$ sapphire/main.php?url=$1&%{QUERY_STRING} [L]