CodeIgniter Forums
Interesting mod rewrite issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Interesting mod rewrite issue (/thread-54617.html)



Interesting mod rewrite issue - El Forum - 09-17-2012

[eluser]Unknown[/eluser]
I'm trying to use htaccess to rewrite
domain.com/foo.js
to
domain.com/codeigniter/someclass

The code I'm using:
Code:
RewriteEngine on
RewriteRule ^foo.js/(.+)$ codeigniter/someclass [L,QSA]
This shows codeigniter's 404 error.

Now, the problem is not htaccess, because when testing with
Code:
RewriteEngine on
RewriteRule ^foo.js/(.+)$ codeigniter/test.php [L,QSA]
everything works fine.

CI is set up with /index/ being hidden and I've tried the default codeigniter/index/someclass as well.

I also tested full urls, like so:
Code:
RewriteEngine on
RewriteRule ^http://domain.com/foo.js/(.+)$ http://domain.com/codeigniter/someclass [L,QSA]
Redirection works, but the new url is disclosed

Any ideas how to get around this?
Thanks for your time.