Jump to:

5541 Posts in 1738 Topics by 1224 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: 1051 Views
  • snaip
    Community Member
    180 Posts

    URL with .html Link to this post


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

    using this solution

    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
    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]


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

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.