Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » URL with .html

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 990 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    URL with .html Link to this post

    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

  • snaip
    Avatar
    Community Member
    180 Posts

    Re: URL with .html Link to this post

    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]

    990 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.