0

I am running a website http://dudesrgamerz.com and getting a 404 error when accessing subfolder of my website (I am running the second script in a subfolder called /apps/). /apps/index.php is working fine but when accessing /apps/detail/zello-ptt-walkie-talkie?appid=com.loudtalks it's not working; it's returning 404 error page.

Here is .htaccess:

<IfModule mod_rewrite.c>
## Uncomment (remove # ONLY NOT ##) line below if installed in folder and add folder name after /
## Example: Script is installed in /public_html/folder/ then it should be: Rewritebase /folder/
## Then the files below should be (add slash to all): /index.php?action=$1
## Uncomment the code below to Use PHP 5.4
# AddHandler application/x-httpd-php54 .php

RewriteEngine On

## Uncomment the following line to use the multi-domain feature
# RewriteCond %{HTTP_HOST} ^yourseconddomain\.com$ [NC]
# RewriteRule ^(.*)$ http://yourfirstdomain.com/$1 [R=301,L]

#Rewritebase /
## Admin Panel
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^admin/(.*)?$ admin/index.php?a=$1 [QSA,NC,L]

## Application Handler
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)?$ index.php?a=$1  [QSA,NC,L]
</IfModule>

## Error 404 ##
ErrorDocument 404 /index.php?a=404
MrWhite
  • 43,179
  • 8
  • 60
  • 84
  • i think you should place `ErrorDocument 404 /index.php?a=404` in .htaccess at top location – Dhaval Purohit Sep 08 '17 at 08:20
  • Where is this `.htaccess` file? What do you want to happen when your access that URL? Do you have other scripts that route URLs? What about `/index.php` in the document root? – MrWhite Sep 08 '17 at 08:39
  • @DhavalPurohit The location of the `ErrorDocument` directive in the `.htaccess` file doesn't actually matter, but it would be more logical (and easier to read) if it was at the top. – MrWhite Sep 08 '17 at 08:41
  • @prince jay ohk but what you are trying to access if its not a file then this htaccess take your control to index.php not the 404 and if its there then it will be served. nothing more than that. also try this link https://stackoverflow.com/questions/22976772/errordocument-404-404-php-is-not-working-in-htaccess-file-in-php – Dhaval Purohit Sep 08 '17 at 08:47
  • @DhavalPurohit thanks for the reply i have placed the code in the .htaccess but the problem still there. please check this [link](http://dudesrgamerz.com/apps/) . I am running a sub script in a sub folder called **(apps)**, the problem is I am getting 404 error page when trying to access another page of the script. –  Sep 08 '17 at 20:35
  • do you have any routes named `apps/` in your laravel routes.php ? – Dhaval Purohit Sep 11 '17 at 07:23
  • @DhavalPurohit no . i have decided to use deferent hosting provider for this subdomain **apps.dudesrgamer.com** . is that okay? how can I do that ? is there any tutorial? –  Sep 11 '17 at 12:11
  • you can do this in your cpanel add subdomain and point it to your apps directory https://documentation.cpanel.net/display/ALD/Subdomains – Dhaval Purohit Sep 12 '17 at 07:18
  • @DhavalPurohit thank you very much, problem solved! –  Sep 14 '17 at 09:37
  • you are welcome @PrinceJay – Dhaval Purohit Sep 14 '17 at 09:40

0 Answers0