1

i have script in directory and on root wordpress is running which is creating problems when i try to run script in sub directory , throwing 404 error

my website structure

wordpress : /
script    : /Software/

my script have urls like

> http://www.domain.com/Software/home
> http://www.domain.com/Software/caseForm
> http://www.domain.com/Software/createuser

so i want that all urls like above to be redirected to index.php of software directory

what i tried

RewriteEngine on
RewriteBase /Software
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

but my current htaccess configuration is throwing me error No input file specified.

4
  • D you want any URI values passed to the index.php page?
    – Martin
    Jul 26, 2016 at 14:25
  • Don't know if it helps but maybe you need to add a slash "RewriteBase /Software/"
    – maalls
    Jul 26, 2016 at 14:27
  • @Martin ya want to pass any uri to index.php inside software dir
    – user889030
    Jul 26, 2016 at 14:49
  • @maalls slash not helped , tried it , thanks
    – user889030
    Jul 26, 2016 at 14:49

1 Answer 1

2

Some precursory notes:

  • The NC tag means No Case meaning the tags are case insensitive. Recommended.
  • The QSA tag means Query String Append meaning things like ?file=filename&horse=neddy from the original URI are appended to the rewritten URI. May be something you'd need here?

To solve Your error:

No input file specified.

Is caused by various issues and can be solved by tweaking the last line to include a ? and removing the preceeding slash from the destination directory, so it become:

RewriteRule ^(.*)$ index.php?/$1 [L]

(Source)

Full rewrite:

RewriteEngine on
RewriteBase /Software
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [NC,QSA,L]

Also review this answer.

6
  • you have to clear your browser cache completely (clear site history) when updating the htaccess file. @user889030
    – Martin
    Jul 26, 2016 at 15:57
  • also I spotted my rewrite has a comment line in it. Updated. @user889030
    – Martin
    Jul 26, 2016 at 15:59
  • tried in private windows , still wordpress 404 pages ... :(
    – user889030
    Jul 26, 2016 at 16:10
  • Read through my source link and see if anything else there fits your criteria. Because you're working in a subfolder of the site you should be aware that the WordPress htaccess of the parent folder will also have an influence over the mod_rewrite etc.
    – Martin
    Jul 26, 2016 at 16:18
  • i tried it works but stuck in loop as index.php have login.php incase user not login. [code] Options -MultiViews RewriteBase /Software RewriteEngine on RewriteRule ^(.*) index.php [/code]
    – user889030
    Jul 26, 2016 at 17:01

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.