Welcome Guest, Not a member yet? Register   Sign In
Problem removing 'index.php' with .htaccess
#11

[eluser]shanecavaliere[/eluser]
I did try yours, it gave me the same result as the others, which is just showing me the CI 'Welcome' page.

The blog controller has an index method. (It works fine when I go to http://example.com/index.php/blog/)

As for the rewrite log, I'm on shared hosting, so I don't think I have the ability to add that...
#12

[eluser]louis w[/eluser]
Try placing this in the welcome controller.

echo 'URI:'.$this->uri->uri_string();

And tell me what it says.
#13

[eluser]shanecavaliere[/eluser]
It just says "URI:" and then nothing after.

I also added that to the blog controller, and went to http://example.com/index.php/blog/, and then it said "URI: /blog/".

...Does that tell you anything?
#14

[eluser]louis w[/eluser]
Ahh ha! Yes. That means that the $1 var is not getting applied to the url when being rewritten.

What kind of system is this running under, and what is your host? Have you ever done ModRewrite on it before?
#15

[eluser]shanecavaliere[/eluser]
Apache 2.2.8 (Unix), hosted by Eleven2.com.

Under this same host, I have successfully used other mod_rewrites before. For example, in the directory /test/babs/ I have an .htaccess file that says
Code:
# this is the initialization
Options     +FollowSymLinks
RewriteEngine     On
RewriteBase     /test/babs
# these are the rewrite conditions
RewriteCond     %{REQUEST_FILENAME}     !-f
RewriteCond     %{REQUEST_FILENAME}     !-d
# and finally, the rewrite rules
RewriteRule     ^([a-zA-Z0-9\-]+)/?$    index.php?page=$1 [L,QSA]
And that works fine.
#16

[eluser]louis w[/eluser]
Try this out (removed the quotes)

Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
#17

[eluser]shanecavaliere[/eluser]
Still nothin Sad
#18

[eluser]louis w[/eluser]
Hmm...... strange.

Why are you using RewriteBase /test/babs in the other one? Are the files not at the http root?
#19

[eluser]shanecavaliere[/eluser]
Yeah, that .htaccess file, as well as the respective index.php file are both in the /test/babs directory.

For this problem, both the CodeIgniter index.php file and the .htaccess file are in the site's root.

Also, I'm not sure if this helps, but when I change the .htaccess file to:

Code:
# this is the initialization
Options     +FollowSymLinks
RewriteEngine     On
RewriteBase     /
# these are the rewrite conditions
RewriteCond     %{REQUEST_FILENAME}     !-f
RewriteCond     %{REQUEST_FILENAME}     !-d
# and finally, the rewrite rules
RewriteRule     ^([a-zA-Z0-9\-]+)/$    index.php/$1 [L]

It sort of works... When I go to 'example.com/blog/' it shows me what I would like, but when I go to 'example.com/blog/index/' it gives me a 404 error.

(edit: sorry, I hit submit before I was ready)
#20

[eluser]louis w[/eluser]
[quote author="shanecavaliere" date="1212628901"]Also, I'm not sure if this helps, but when I change the .htaccess file to:

[/quote]

What happens?




Theme © iAndrew 2016 - Forum software by © MyBB