HTML: ZIP file download from server issue - php

I'm sorry about my tittle. I'm not sure how I can categorize this question.Please do edit if necessary-Thanks
Here is the issue I'm having:
http://domain.com is my main server- in this main server I'm listing all of the downloadable files I have from another server which is http://myfilehost.com.
on http://domain.com I list my files like so:
download myfile document
download all myfile
The first link is working perfectly fine but when it comes to the zip file I always get the ff error which is really weird:
Here is the htaccess of http://myfilehost.com which I think is the default of wp as its also a wp website not sure if this is hosted on hostgator/bluehost:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
And o I think this is also worth mentioning:
When I try to go to http://myfilehost.com first and wait for it to load then add the directory /downloads/myfile.zip to the URL its actually working perfectly and downloading myfile.zip..
Thank you Everyone for your kindness of helping me and giving me a response

Related

Can't open XAMPP & CodeIgniter Windows 10

In 2016/17 I had XAMPP working good but then I had one year rest and needed to reinstall Windows 10 and when I attempted to open the control panel it would not open.
I then decided to download the latest version of XAMPP and also CodeIgniter. I have transferred all of the files from the old version to the new version. I am able to open http://localhost/phpmyadmin and I have created a database with a table similar to that I had before. But if I enter http://localhost/intro I get the result of Object not found! - Error 404. I have checked routes.php and everything appears OK and I've also placed the Intro file (which is simple text without reference to the database) in the root folders of Controllers & Views, but get the same result. I have also checked config.php and changed $config['base_url'] = 'http://localhost/'; to $config['base_url'] = 'http://127.0.0.1:8080/localhost/'; but again it made no difference. I also changed the port number in the Control Panel to 8080 but again made no difference.
I guess by being able to open http://localhost/phpmyadmin that indicates Apache is working OK.
Can somebody tell me where else I can check?
If you are sure xampp is running perfectly then add .htaccess file in the main directory of the intro, add the following code into it:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]
and try again. If you got any error let me help you.
My old system had a .htaccess file and there was not one in my new system. I copied & pasted that file and everything works good now.
My file contained the following.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
Header add Access-Control-Allow-Origin "*"

Why does removing the / from the end of URL give me a 403?

Hello I recently coded a storefront child theme on Wordpress on my localhost and used the Free Version of Duplicator to move it to my website's server for demo. The website works fine at this url: http://connorperzely.com/advancedpowereq.com/
However, when I try to load it at the same URL without the trailing "/" it returns a 403: http://connorperzely.com/advancedpowereq.com
Why does the 403 occur when the / is removed from the end of the url? And how can I fix it so it will work as normal?
Here's my .htaccess:
# This file was updated by Duplicator on 2017-08-18 23:29:51. See .htaccess.orig for the original .htaccess file.
# Please note that other plugins and resources write to this file. If the time-stamp above is different
# than the current time-stamp on the file system then another resource has updated this file.
# Duplicator only writes to this file once during the install process while running the installer.php file.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /advancedpowereq.com/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /advancedpowereq.com/index.php [L]
</IfModule>
# END WordPress
It is working as expected according to your .htaccess file.
The url: http://connorperzely.com/advancedpowereq.com ending id .com therefore it is recognized as a file and the line
RewriteRule . /advancedpowereq.com/index.php [L] is not reached.
It is not recomended to have a dot in your subdomain, and http://connorperzely/advancedpowereq will work fluently

Moving wordpress site from hosting to localhost for development

After moving website to my local dev machine, relative links stopped working. When i click button with relative link /login, for example, browser redirects to
https://localhost/login/
and shows
Code: Not Found
The requested URL /index.php was not found on this server.
While it should have redirected to https://localhost/сс/login/
.htaccess contents on localhost:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cc/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cc/index.php [L]
</IfModule>
Website files are in var/lib/html/cc folder.
SiteURL and HomeUrl
are both equal to http://localhost/сс
Parmalinks setting http://localhost/cc/sample-post/ is used, so no problem with navigating to pages.
How to fix this issue?
Tried different .htaccess modifications, moving index.php to /var/lib
Nothing helps.
just use WP Migrate DB plugin for database export , it will change all link to your desire link and use this database export file in live site
Link ( https://wordpress.org/plugins/wp-migrate-db/)

CodeIgniter .htaccess for my file structure

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]
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]

PHP file in WordPress Directory

I have created a folder within WordPress public_html folder and created a test.php file in it as below.
www.mysite.com/myfolder/test.php
When I navigate to this url, I get page not found 404 error. All other files in myfolder, e.g. test.txt load without any issues. It's just php files that are not running. Could anyone please help?
My .htaccess file is
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
WordPress has its own .htaccess that is probably treating your URI as some sort of "Search Engine Friendly" thing, and translating it into some other format that WP is expecting. For example, http://www.mysite.com/myfolder/test.php might get rewritten to something like http://www.mysite.com/myfolder/index.php?target=test%25php. That would give a 404 error from within WP (not a real server 404 error). Perhaps something can be done from within WP's configuration, or you could modify the .htaccess to tell it specifically not to rewrite test.php.
This is weird since WP leaves your files alone due to RewriteCond %{REQUEST_FILENAME} !-f condition.
Try creating a myfolder/.htaccess file with this line:
# just one line here
RewriteEngine On
This will basically nullify all rewrite rules of parent folder.
Please check file-folder permission of myfolder. It should not be 777 instead it should be 755 on your server.
Please refer Wordpress php file execution

Categories