0

I've been working on my first MVC-Based PHP application recently, using the CodeIgniter Framework. The project is now ready to go live for my friend/user to evaluate. As per the documentation, I have set the base url to 'http://sitename.co.uk/subdir/'.

When I browse to http://sitename.co.uk/subdir I'm redirected to http://sitename.co.uk/sitename/subdir. My shared hosting has a parent directory containing children directories with the name of each site I am hosting. I believe this is perhaps the cause of this.

I have attempted modifying the .htaccess, on the off-chance that this was overwriting the base url defined in config.php, though this did not appear to be the case. The base_url in config.php appears to have no affect on where I'm redirected to when browsing to this page.

The line for the base url currently reads:

$config['base_url'] = 'http://sitename.co.uk/subdir/';

As always, any assistance is appreciated. I have little experience with web publishing.

1 Answer 1

1

Setting $config['base_url'] does not do any redirection check if you have .htaccess it should have this code

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.