Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8130637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:47:35+00:00 2026-06-06T08:47:35+00:00

I started working on CodeIgniter recently and I’m having some issues with the .htaccess

  • 0

I started working on CodeIgniter recently and I’m having some issues with the .htaccess and the base_url() function causing issues. I hope this is just a noob error and has a quick fix!

Pretty much what happens is that now with the .htaccess the index.php is gone from the url which is amazing but now I am having issues linking stylesheets and js files with my templates.

In all the tutorials I have read/watched, they have included the .htaccess and then still set their base_url() and then using “link_tag(href);” to link their .css but now I am getting a double up on the url. For instance when I tried to add the stylesheet, the path that it looked for was:

http://www.mysite.com/site/www.mysite.com/site/css/stylesheet.css

So my first thought was just to remove my base_url() so that the .htaccess does everything but it doesn’t work. With the .htaccess I can have a site without the index.php being there but without stylesheets or JavaScript files linked or I can have a site with some styling, but deal with the index.php. There must be a way that both will work simultaneously?

Also, I did a fix by instead of using the link_tag() I just echoed out a normal link tag which works perfectly in the beginning when its still:

http://www.mysite.com/

But if the login is incorrect and I redirect to load the login view again, the styling disappears because its now using the relative path from:

http://www.mysite.com/user/login

Thanks in advance! Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:47:37+00:00Added an answer on June 6, 2026 at 8:47 am

    Try

    RewriteEngine on
    RewriteCond $1 !^(css|js)
    RewriteRule ^(.*)$ /index.php/$1 [L]
    

    So www.mysite.com/css/mycss.css is retrieved normally where as www.mysite.com/something is passed to codeigniter.

    To get the css file with base_url() you would do base_url("css/mycss.css"), which should result in "http://www.mysite.com/css/mycss.css"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started working with CodeIgniter and I am having some trouble with the
Just started working with .NET and MVC(1). I'm having a problem wherein in my
I started working in Python just recently and haven't fully learned all the nuts
I just started working with jqGrid this week. I'm attempting to make a generic
Hello I just started working with CodeIgniter framework. My current directory structure is Demo(Project
Just started working on a c project. Need help with passing function pointers/macro functions/etc.
I have just started working on localization of this application. Starting with three tab
I've just started working on an ASP.NET project which I hope to open source
I’ve recently started working on a Win Forms application which needs some improving and
I've recently started working with JPA on the Google App Engine. In reading some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.