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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

URL with .html


Go to End


2 Posts   1512 Views

Avatar
snaip

Community Member, 181 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, 181 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]