How to keep url_suffix from automatically being appended to links?

I am using $config['url_suffix'] = '.php' in my config file. The need is that some payment websites require an extension to the redirect link, which solved the problem. However, I am getting .php appended to almost every link on my website! I guess they are only the links that utilize anchor() function.

please tell me, is there a way to disable that?


[eluser]Colin Williams[/eluser]
Hrm... the fact that anchor() appends this is probably, generally, a good thing. Since the ".php" extension existence is the requirement of an outside service, it might make sense to re-engineer your setup to only react to that one condition, probably through mod_rewrite rules. Changing this line in your .htaccess or httpd.conf from

RewriteRule ^(.*)$ /index.php/$1 [L]


RewriteRule ^(.*)(\.php)?$ /index.php/$1 [L]

might do the trick, but you probably have to go to greater lengths to get it to work, and might want to specifically single-out the requesting server that requires the ".php" extension. Basically you're saying, "route anything like xxxxx.php to index.php/xxxxx." Don't know if this would mess up the valid index.php requests or not...

I would simply add .html to the requests that need it and address this either in .htaccess or with a with a route.

In .htaccess if the extension is .html and rewrite to the the stripped version


$routes[(my/specific/redirect/link).html]=$1; // or fancier...


[eluser]Colin Williams[/eluser]
Good call, Mirage. CI Routing might be a bit more hassle-free than a tricky mod_rewrite.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.