.htaccess or custom php

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
klemme
New Member
New Member
Posts: 2
Joined: Tue Mar 05, 2013 9:20 am

.htaccess or custom php

Post by klemme »

Hi all,

I need to create either redirects hardcoded through htaccess file in cmsmadesimple.

First:

Is it the correct file location, for the htaccess file: In the /doc folder?

I inserted a redirect there, but with no effect. And also: how come it is not in the root folder?

Second option:

I have created a PHP function, that holds an array of all the urls I need to redirect. I inserted the PHP code, in the very top of the index.php page, but it didnt redirect anything? I did tjeck the function, and it is working fine..

To insert custom PHP code, before any of the page is rendered: Is it correct to do that through the index.php file. Or is it in another file that is included in the header of the site?

Any help is highly appreciated in this matter.

Best regards, Jan
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: .htaccess or custom php

Post by paulbaker »

klemme wrote:Is it the correct file location, for the htaccess file: In the /doc folder?
You need to move the htaccess.txt from docs to your root and rename it .htaccess. This file is mainly used to set up pretty URLs.

If you just want your own "custom" redirects then just create your own blank .htaccess in the root and add redirect rules. Google will help you with the exact syntax to use.
Locked

Return to “[locked] Installation, Setup and Upgrade”