I have a strange problem. Everything was working fine untill yesterday and suddenly just noticed this problem.
The webiste is here:
http://www.famtripsandinspectionvisits.com/all_trips
If you visit above page and click on “india-kerala” link, it should take you to the following page.
http://www.famtripsandinspectionvisits.com/trips/old_trips/india_kerala
However the browser redirects to this page:
http://www.famtripsandinspectionvisits.com/all_trips/old_trips/india_kerala?/trips/old_trips/india_kerala
This indicates that the following part was added that is extra.
all_trips/old_trips/india_kerala?
I checked my .htaaccess and reset it to defaultbut it still doesn’t affect it. I checked my cofnig.php for base url and everything is same as before. If anyone can help, I will appriciate.
my .htaccess file
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
Redirect 301 /invest.php http://www.famtripsandinspectionvisits.com/investment_opportunity
Redirect 301 /buyers.php http://www.famtripsandinspectionvisits.com/buyers
Redirect 301 /trips.php http://www.famtripsandinspectionvisits.com/all_trips
Redirect 301 /sellers.php http://www.famtripsandinspectionvisits.com/sellers
Redirect 301 /contact.php http://www.famtripsandinspectionvisits.com/contact_us
Redirect 301 /about.php http://www.famtripsandinspectionvisits.com/about_us
Redirect 301 /login.php http://www.famtripsandinspectionvisits.com/login
Redirect 301 /trip-kerala.php http://www.famtripsandinspectionvisits.com/trips/old_trips/india_kerala
Redirect 301 /trip-burundi.php http://www.famtripsandinspectionvisits.com/trips/up_coming_trips/burundi_africa
Redirect 301 /register.php http://www.famtripsandinspectionvisits.com/register
Redirect 301 /trips http://www.famtripsandinspectionvisits.com/all_trips
My routes.php
$route['default_controller'] = "site";
$route['404_override'] = '';
$route['fam_admin'] = "fam_admin/login";
/* End of file routes.php */
/* Location: ./application/config/routes.php */
Kind regards
I think what you need to do here is tell mod_rewrite that you want to combine the new and old query strings, which requires the use of the QSA flag:
That is my ‘standard’ base set of rules for my Codeigniter projects, the rest I accomplish much as you have with custom routes and the occasional redirect.
Ending the substitution with just a question mark (in the absence of the QSA flag) will erase the existing query string and replace it with the new one, which I think explains what you’re seeing.
The documentation for mod_rewrite gets a bit more in depth when it comes to this: