• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
clean urls, oauth, twitter

#1
[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!

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


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

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

#3
[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.

#4
[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

#5
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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