CodeIgniter Forums
clean urls, oauth, twitter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: clean urls, oauth, twitter (/showthread.php?tid=29527)



clean urls, oauth, twitter - El Forum - 04-12-2010

[eluser]Unknown[/eluser]
I'm using the Elliot Haughin library for Twitter integration. I appreciate the library but seem to be banging my head to get it to work. My site uses clean urls which instantly seem to break when I change the URI_PROTOCOL to Path_Info. Is anyone using oauth, twitter and ci with clean urls?

Thanks!


clean urls, oauth, twitter - El Forum - 04-24-2010

[eluser]SaJu[/eluser]
Please try with following settings


$config['uri_protocol'] = "ORIG_PATH_INFO";

$config['permitted_uri_chars'] = 'a-z? 0-9~%.:_\-';


clean urls, oauth, twitter - El Forum - 05-12-2010

[eluser]Larry Rubin[/eluser]
If you're having the problem described by the OP, take a close look at your mod_rewrite rules.

Removing the "?" from the following line solved the problem for me:

Code:
RewriteRule ^(.*)$ /index.php?/$1 [L]

The working form looks like this:

Code:
RewriteRule ^(.*)$ /index.php/$1 [L]

I am now able to use Elliot's Twitter OAuth lib with clean URLs.

I'll post again if I discover anything breaking from this change.


clean urls, oauth, twitter - El Forum - 06-18-2010

[eluser]luisfmgoncalves[/eluser]
Hello all,

I have the thing working in my laptop (with Ubuntu) and in my desktop (with windows and XAMPP).

When I put the files in the server where the application will be, stops working. I can see that when I change:

Code:
$config[‘uri_protocol’]  = “PATH_INFO”;

to

Code:
$config[‘uri_protocol’]  = “AUTO”;

I can get some things work (like a search in twitter). But when I try to login (through Twitter) I'm not redirected back to my application. Instead, the got the twitter confirmation page again with a new ticket.

My .htaccess is like this:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^project.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|stylesheets|system/application/sources/)
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>
AddHandler x-httpd-php5 .php .php3 .php4 .phtml # phpvs v5

If I take the ? symbols in RewriteRule ^(.*)$ index.php?/$1 [L] it will not work.

Any suggestion?

Thanks,

Luis


clean urls, oauth, twitter - El Forum - 08-16-2010

[eluser]Unknown[/eluser]
[quote author="Larry Rubin" date="1273737107"]If you're having the problem described by the OP, take a close look at your mod_rewrite rules.

Removing the "?" from the following line solved the problem for me:

Code:
RewriteRule ^(.*)$ /index.php?/$1 [L]

The working form looks like this:

Code:
RewriteRule ^(.*)$ /index.php/$1 [L]

I am now able to use Elliot's Twitter OAuth lib with clean URLs.

I'll post again if I discover anything breaking from this change.[/quote]

Thanks. This worked for me.