• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
htaccess issue

#1
[eluser]metamorpher[/eluser]
Hi, I just set up my first CI site, and started to have some problems with the rewrite engine...

My server doesn't recognize my directives, and I've just used the example below:

Code:
Options -Indexes
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|xajax_js|source|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]


which is in the wiki...


the url is paraguayito.com, where I display some news of my country. I get them via rss and store them into my database... I use a redirect function built by myself. It stores one clic for the article, so I can have some sort of tracker and uses php header function to redirect the browser to the article permalink...


I think it's htaccess 'cause when I enter /index.php/ inside the url it does the right stuff... so, can you help me?

#2
[eluser]metamorpher[/eluser]
i have to add that when I was testing it on localhost my entire site was on localhost/par/, so htaccess looked like

Code:
Options -Indexes
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|xajax_js|source|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /par/index.php/$1 [L]

and just worked... I don't know what's the issue around this :S

#3
[eluser]metamorpher[/eluser]
AND

I used routes... 'cause my class is named feed, redirect is just a function inside feed, so i rutted it this way

Code:
$route['redirect/:num'] = "feed/redirect";

so, I didn't have to use feed in my url...

#4
[eluser]metamorpher[/eluser]
I just wanted to tell you that the problem is fixed...

I don't know how but added a question mark and miracously got fixed :S


I though in my mind "wtf, I find a joker"...

finally i've got this

Code:
Options -Indexes
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|xajax_js|source|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php?/$1 [L]


hope somebody could explain at least! Thanks

#5
[eluser]TheFuzzy0ne[/eluser]
Well spotted! Thanks for posting how you fixed the problem, too.

#6
[eluser]Colin Williams[/eluser]
Your server probably isn't setting up the PATH_INFO environment variable in the way CI expects. You could likely get rid of the ? mark and set $config['uri_protocol'] to 'REQUEST_URI' or 'ORIG_PATH_INFO' and it would work out for you.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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