Welcome Guest, Not a member yet? Register   Sign In
.htaccess redirect issues
#1

[eluser]exodus7[/eluser]
I seem to be having some problems with my .htaccess file when I add a redirect to it.

This is what I had originally:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
AddHandler php5-script .php
This is what I had after:
Code:
RewriteEngine On
RewriteRule ^index\.php\?id\=1$ http://www.mydomain.net/index.php/home/ [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
AddHandler php5-script .php
I've also tried:
Code:
RewriteEngine On
RedirectMatch permanent ^/index\.php\?id=80$ http://www.mydomain.net/services
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
AddHandler php5-script .php
And tried this:
Code:
RewriteEngine On
RedirectMatch 301 ^/index\.php\?id=80$ http://www.mydomain.net/services
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
AddHandler php5-script .php

But still no luck. What did I do wrong?
#2

[eluser]gabe[/eluser]
Are you trying to remove index.php? If so this should do you well. It also allows you to access the user_guide, css, js, images, and media directories.

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|user_guide|css|js|media|robots\.txt)
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
#3

[eluser]exodus7[/eluser]
My problem is a little bit more complicated. Here's some background information: Im currently converting a site that half was built using TYPO3 CMS, and the other half was done by someone else using simple html & php includes. (Why it was done like this- i'll probably never know). In any case, the TYPO3 part was switched to CI, and the rest of the site, I just left it alone for now. The .htaccess settings that im currently using:

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
AddHandler php5-script .php

verifies to see if the file exists, if not, it goes to index.php for CI to handle. This will allow the other part that was not created in CI to work. So now, I need to take the old links from typo3 which end in "index.php?id=3" (note the id# is different for ever page) and have it redirected using a 301 request to allow all of the old locations to be redirected. The code you supplied doesn't work.....
#4

[eluser]gabe[/eluser]
No, the code that I supplied would be far from adequate for what you want. You have a pretty little problem and although it isn't helpful I suggest you might try the Apache mail list?
#5

[eluser]exodus7[/eluser]
ok so I tried the code you gave me and I ran into some trouble. I have a flash movie that loads pictures & other data using XML and now its not loading anything. I tried to revert back to what I had before in my .htaccess file, and im still not getting anything even though I didn't change any files... Any ideas?




Theme © iAndrew 2016 - Forum software by © MyBB