0

I tried a lot to get the result i.e. .html or / as URL suffix, but failed.

My config.php is like...

$config['base_url'] = 'http://localhost/domain/';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '.html';

My web.config is like...

<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
  <system.webServer>
    <rewrite>
      <rules>
         <rule name="Clean URL" stopProcessing="true">
            <match url="^(.*)$" />
            <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
        </rule>
    </rules>
</rewrite> 

My autoload.php is like...

$autoload['helper'] = array('url', 'file');

My URL is showing like...

http://localhost/domain/view_details/get/some_details

where I want the URL like...

http://localhost/domain/view_details/get/some_details.html

I tried this and this also, but failed.

What should I do ?

2
  • What do you mean by showing. What happen when you hit .html link. Commented Aug 24, 2016 at 20:54
  • @ShaifulIslam First of all thanks for your answer. If I write .html after the link and hit, no problem happens, it shows/display the page properly. But .html is not append automatically. Commented Aug 25, 2016 at 6:22

1 Answer 1

2

I do not see any code where you producing links. To produce a link you should use site_url

From your config.php

echo site_url('test');
//will produce 
//http://localhost/domain/test.html

echo site_url('view_details/get/some_details');
//will produce 
//http://localhost/domain/view_details/get/some_details.html
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Shaiful Islam for the answer. It works. Thanks again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.