CodeIgniter Forums
URL Rewrite not working correctly - 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 not working correctly (/showthread.php?tid=5169)



URL Rewrite not working correctly - El Forum - 01-09-2008

[eluser]Unknown[/eluser]
Hi all, my host is dreamhost and I've been having problems with the URL rewrite. It used to work but after installing subversion on my site i need to prevent it from rewriting /svn/ and now it's been acting weird. When I go to my site, it redirects me to www.mysite.com/authcontrol however the following error shows up:
Quote:404 Error The requested URL /authcontrol was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
But when I type in www.mysite.com/index.php/authcontrol, the page shows up, but still the links all point to www.mysite.com/somelink and not www.mysite.com/index.php/somelink.

So I tried renaming my .htaccess to s.htaccess so it won't be read by the server. But nothing changes! Is the server just taking long to propage my .htaccess file? I've been on this since yesterday and nothing has changed.

Here's my .htaccess file:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond $1 !^(svn)
    RewriteCond $1 !^(index\.php)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI}  ^/svn [NC]
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>

    ErrorDocument 404 /index.php
</IfModule>



URL Rewrite not working correctly - El Forum - 01-09-2008

[eluser]Unknown[/eluser]
Never mind, I got it working. It seems that I had an error with my RewriteCond for svn (It was only allowing svn folders?)

changed this one:
Code:
RewriteCond %{REQUEST_URI}  ^/svn [NC]

to:
Code:
RewriteCond %{REQUEST_URI}  !^(svn|index\.php) [NC]