htacces takes me to localhost instead of removing index.php |
[eluser]behnampmdg3[/eluser]
Hello; I am trying to get rid of index.php in url, but it shows me the local host (one directory above what I want) instead of main folder. What am I doing wrong? Thank you Code: RewriteEngine on
[eluser]InsiteFX[/eluser]
Code: php_value default_charset utf-8 And make sure you place it in the directory with index.php
[eluser]behnampmdg3[/eluser]
[quote author="InsiteFX" date="1355828511"] Code: php_value default_charset utf-8 And make sure you place it in the directory with index.php [/quote]Hello; This does the same. Takes me to localhost!
[eluser]davidMC1982[/eluser]
Do you have your site in a subfolder under your webroot? If so, you may want to try InsiteFX's .htaccess but change: RewriteBase / to RewriteBase /nameofsubfolder/
[eluser]InsiteFX[/eluser]
And what happens if you donot use an .htaccess file?
[eluser]behnampmdg3[/eluser]
[quote author="behnampmdg3" date="1355827364"]Hello; I am trying to get rid of index.php in url, but it shows me the local host (one directory above what I want) instead of main folder. What am I doing wrong? Thank you Code: RewriteEngine on This is how I import the css Code: <link href="<?php echo base_url();?>css/styles.css" rel="stylesheet" type="text/css" />
[eluser]InsiteFX[/eluser]
Try this: Code: <link href="<?php echo base_url('css/styles.css'); ?>" rel="stylesheet" type="text/css" /> This is the correct way to use base_url() Also check to make sure your config base_url is set correct, or leave it blank and CI will try to figurre it out for you.
[eluser]behnampmdg3[/eluser]
[quote author="InsiteFX" date="1355887000"]Try this: Code: <link href="<?php echo base_url('css/styles.css'); ?>" rel="stylesheet" type="text/css" /> This is the correct way to use base_url() Also check to make sure your config base_url is set correct, or leave it blank and CI will try to figurre it out for you. [/quote]Hello; Thank you for your reply. Unfortunately it didn't work. Code: <link href="<?php echo base_url('css/styles.css');?>" rel="stylesheet" type="text/css" /> Still clicking on css link from the source takes me to 404! base_ulr in cofig is blank, I checked that. Please dont give up on me. Thank you
[eluser]InsiteFX[/eluser]
What OS and Server software are you running? Your problem seems to be a setup problem or a bad download of CodeIgniter.
[eluser]jojo777[/eluser]
Hi! try this! This is my normal .htaccess file when i work at localhost. For example I've in /var/www folder my projects, so: Code: <IfModule mod_rewrite.c> That should work fine! |
Welcome Guest, Not a member yet? Register Sign In |