![]() |
URL Rewrite Rules for IIRF - 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: URL Rewrite Rules for IIRF (/showthread.php?tid=17577) Pages:
1
2
|
URL Rewrite Rules for IIRF - El Forum - 04-08-2009 [eluser]koryrok[/eluser] Hi All, Im using CI on Windows. Can someone please tell me what the IIRF re-write rules are for removing index.php from the URL? Thanks, Kory URL Rewrite Rules for IIRF - El Forum - 04-08-2009 [eluser]Clooner[/eluser] Code: #Don't rewrite when it has one of these extensions http://iirf.codeplex.com/Wiki/View.aspx?title=Examples&referringTitle=Home URL Rewrite Rules for IIRF - El Forum - 04-08-2009 [eluser]koryrok[/eluser] [quote author="clooner" date="1239267534"] Code: #Don't rewrite when it has one of these extensions http://iirf.codeplex.com/Wiki/View.aspx?title=Examples&referringTitle=Home[/quote] Are you sure there is a dash near the end of the first rule? I tried it with and without the dash and all I get is a 404 URL Rewrite Rules for IIRF - El Forum - 04-08-2009 [eluser]Clooner[/eluser] [quote author="koryrok" date="1239269653"]Are you sure there is a dash near the end of the first rule? I tried it with and without the dash and all I get is a 404[/quote] Try this: Code: RewriteCond %{REQUEST_FILENAME} !-f In case still having problems post your ini file and how and what you exactly try to rewrite... URL Rewrite Rules for IIRF - El Forum - 04-09-2009 [eluser]koryrok[/eluser] The above rules don't work either. The only rule so far that sort-of works is: Code: RewriteRule ^/([^/]+)$ /index.php?/$1 [I] which works for urls like: http://www.mysite.com/page but fails for http://www.mysite.com/page/var1 or http://www.mysite.com/page/var1/var2 URL Rewrite Rules for IIRF - El Forum - 04-09-2009 [eluser]Clooner[/eluser] [quote author="koryrok" date="1239278090"]The above rules don't work either. The only rule so far that sort-of works is: Code: RewriteRule ^/([^/]+)$ /index.php?/$1 [I] which works for urls like: http://www.mysite.com/page but fails for http://www.mysite.com/page/var1 or http://www.mysite.com/page/var1/var2[/quote] Because your regex only matches when there is only one "/" change it to ^(.*)$ .matches any character * means 0 or more ^=start of string $end of string Basically saying any string your regex only matches when there are not more then one forward slashes Code: RewriteRule ^(.*)$ /index.php?/$1 [I] should work... Be sure to correctly set the location of the index.php file! (see the forward slash before your index.php) This should also work Code: RewriteCond %{REQUEST_FILENAME} !-f URL Rewrite Rules for IIRF - El Forum - 04-09-2009 [eluser]koryrok[/eluser] [quote author="clooner" date="1239279149"] This should also work Code: RewriteCond %{REQUEST_FILENAME} !-f That did it. Everything seems to be working perfectly. Thank you so much!! :-) URL Rewrite Rules for IIRF - El Forum - 04-09-2009 [eluser]gatewaylabs[/eluser] Hi, mod_rewrite is used for rewriting a URL at the server level in Apache Web Server, giving the output for that final page for search engine & visitors. If you have Apache server than you can use .htaccess file to rewrite the URl URL Rewrite Rules for IIRF - El Forum - 04-09-2009 [eluser]Clooner[/eluser] [quote author="gatewaylabs" date="1239297780"]Hi, mod_rewrite is used for rewriting a URL at the server level in Apache Web Server, giving the output for that final page for search engine & visitors. If you have Apache server than you can use .htaccess file to rewrite the URl[/quote] Mod_rewrite is the Apache Module to do the url rewriting or redirecting. You can configure this in the .htaccess file. Ionics Isapi Rewrite Filter is the IIS ISAPI filter dll which handles the rewrites or redirects. You can configure this using ini files. The nice thing is that the syntax is for the most part the same. URL Rewrite Rules for IIRF - El Forum - 04-09-2009 [eluser]gatewaylabs[/eluser] Hi clooner, Thanks for your reply but if i rewrite url than how search engine will reach to my new url because they have older version of the Url in their index ..if you have any idea than please share with me. Regards, Chirag |