0

I was handed down a project from another developer (who's not available any more and I cannot ask him for a solution) where he'd kept multiple codeignitor projects in a folder and called each of them through their respective index files.

The file structure - /var/www/html/{folder}/mobile_index.php

The mobile_index.php references a folder 'mobile' which resides in the same folder as mobile_index.php.

So the URL that I call is - "xx.xx.xx.xx/{folder}/mobile_index.html". This page opens fine but when I click on any link (e.g. user) within the page, this redirects to "xx.xx.xx.xx/user"

Now this page is blank and my error log says there's no page user in /var/www/html/user. But when i manually convert the link to "xx.xx.xx.xx/{folder}/mobile_index.php/user" this works and opens up the page. I think the folder is missing the .htaccess file but I have no clue what to include in that file, can anyone help me get the links working again?

This is what I have so far -

    RewriteEngine on 
    RewriteCond $1 !^(mobile_index\.php|images|robots\.txt) 
    RewriteRule ^(.*)$ /{folder}/mobile_index.php/$1 [L]
3
  • What have you done so far? Commented May 14, 2015 at 10:39
  • RewriteEngine on RewriteCond $1 !^(mobile_index\.php|images|robots\.txt) RewriteRule ^(.*)$ /{folder}/mobile_index.php/$1 [L] Commented May 14, 2015 at 10:41
  • Please add that code to your question Commented May 14, 2015 at 10:45

1 Answer 1

1
Options +FollowSymLinks
RewriteEngine On
#RewriteBase / #on server, uncomment this line by removing hash'#'
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* mobile_index.php?/$0 [PT,L,QSA]
Sign up to request clarification or add additional context in comments.

2 Comments

Doesn't work. This is the error that I get now - "/var/www/html/mobile_index.php' not found or unable to stat"
Rename your index.php to mobile_index.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.