XAMPP is displaying parent directory - windows

I installed XAMPP on my Windows 2008 server and created a new folder in the HTDOCS folder and the user can access the pages using the link.
For example:
http://1.1.20.305/MyDB/index.php
Will take the user to the index.php page.
But if I enter the following in my browser:
http://1.1.20.305/MyDB/
It displays the parent directory with all the files.
It is a security risk and how do I prevent it from happening? It should auto-route user to the index page or somewhere I define.

I added the .htaccess and .htpasswd file in the directory and the directory is not shown anymore.

Related

Changing ScotchBox Path to index.php

I have my local dev environment running with ScotchBox, but I have a few questions. I have my entire project directory in ScotchBox's public folder, but because my index.php file is in a Website subdirectory, when I open it in the browser, I have to click into the subdirectory to get to the page.
This isn't a project killer, but it would be nice to change where ScotchBox is looking for index.php. Is there a way to do this?

Where to upload my PHP files on web hosting server?

I have a GoDaddy web hosting account with a cPanel access. I am trying to figure out where should i upload my php files.
I have created a new folder inside the public_html folder as fortnox_invoicing and have copied all the code (PHP/HTML/JS) files in that folder.
But when i try to browse the php files it doesn't work instead i get "ops, this page does not exist" message.
http://example.com/fortnox_invoicing/index.php
Following is how the public_html directory looks like for now:
You can upload your PHP files in public_html if you want to browse your website like:
http://example.com
You can also upload PHP files in subfolder if you wish to browse it like
http://example.com/subfolder
If you are receiving error 404 while browsing subfolder, locate .htaccess file and check if there is any rules that are restricting index.php to load and causing 404 page. If .htaccess file is hidden, you'll have to enable the show hidden file in while opening cPanel File Manager. Try renaming .htaccess file and load your website again. Also make sure that root folder contains index page and it is listed as default page in .htaccess file.
You see this page because your website doesn't have "index.php" or "index.html" file in public_html folder.
for example
-public_html
-index.php
**-subfolder**
-aboutus.php
-contact.php
-service.php
**-subfolder**
-thankyou.php
Most service providers use the above hierarchy.

Xampp redirects to /xampp

I just installed codeIgniter on my xampp but whenever I try to go to it's folder (localhost/ci) , it instead takes me to localhost/xampp
Can't find what else is needed to do.
Rename index.php in your htdocs folder to index1.php,
then try to access http://localhost,
so now you will see Apache's default Directory listing instead of XAMPP homepage.
If you somehow want to move back to the default XAMPP homepage, do rename index1.php to index.php
It's not really necessary to put your codeigniter project in the htdocs folder of xampp. You can also save it somewhere else.
To run it, go to C:\xampp\apache\conf\httpd.conf and replace the line DocumentRoot "/home/user/www" to your liked one.
"index.php" kept in htdocs directory works as redirection.
Open this file with notepad or in other editor.
At this line:
header('Location: '.$uri.'/xampp/');
Replace xampp with the name of your website directory name ie root:
header('Location: '.$uri.'/bulandshahr/');
Your website will work.

www.localhost.com/magento and Index of /magento page shows up

I am trying to install Magento on localhost.
actually, I am a beginner of Magento and stackoverflow.
I have followed guide book and I downloaded Magento sample file.. and unzipped the file at c:/xampp/htdocs/magento
also modified the host file..
whenever I am trying to enter the
www.localhost.com/magento
index of magento page shows up.like ftp server.
How can I open the Magento file as well guide book..
I do not use xammp so I don't know how it's directory structure looks like, but: it looks like you are installing Magento in a subdirectory, right?
If you do so, you have to edit .htaccess. Change RedirectBase to the name of your subdirectory. So here it should be /magento/ And if the RedirectBase line in .htaccess is commented out delete the # at the beginning of that line.
Once magento zip file is unzipped drag the unzipped file in
c:xampp/htdocs/(magento unzipped folder) --->> this is root directory of magento
Now we web browser hit this url
http://localhost/(magento unzipped folder name)
if you are hitting this url first time it asks for configuration and admin url name
to access admin panel
http://localhost/(magento unzipped folder name)/admin url name
That seems to be related with your webserver configuration, and not Magento. If you have Apache, for instance, have a look at your configuration file httpd.conf, and check the line that starts with "DirectoryIndex".
You need to have "index.php" as a valid index file. If you don't, just add it right after DirectoryIndex, restart Apache and it should work fine.
/etc/httpd/conf -> usual location for the httpd.conf file (standard installation, RedHat/CentOS family)
Depending on configuration in the .htaccess file, you might need to specify index.php in the url as such: localhost/magento/index.php or (www.localhost.com/magento/index.php as per your comment) to access it.
Check your virtual host configuration file for the domain name that you are using. If the directory index is missing in the configuration then the apache server will not be able to determine the entry point for the website and will list all of the files.

How To Direct Magento installation path in subfolder to main domain name

I have installed Magento 1.7.0.2 to mydomain.com/mag
(mydomain - is the primary registered domain at my hosting account)
(mag - is any subfolder)
As my website in testing mode, if anything goes wrong, i simply have to delete the “mag” folder and also it does not overwrite any files under public_html.
But if i install on directly to root directly public_html, then it may overwrite few files or folders and if i want to revert any time, then i cannot do that manually.
As i don’t even know the exact folder and file default structure under public_html prior to magento installation.
(I did that once by mistake, that happened)
Now at frontend the site URL will be mydomain.com/mag
But i want, if customers type the http://www.mydomain.com, they will be able to see the LIVE website instead of typing http://www.mydomain.com/mag
How do i do that
Also, will this be OK for SEO part.
Do we need to do this in Magento backend.
or
Do we need to do with hosting company by setting sub-domain type
or
By telling Simple scripts the installation to change the installation folder from mydomain.com/mag to www.mydomain.com
Please do suggest how can i do so.
Regards
In System > Config > Web you will find the following settings for your 'base url'. To update this you will have to perform the following 3 steps:
Step 1: Set the default store to the proper base url
Notice that the base url has the subfolder defined.
Step 2: Set your STORE VIEW base url to the root url
Using your dropdown on the left, change the "Current configuration scope" to your store view [NOT DEFAULT]
To change the base url value, uncheck 'use website' and enter your new base url:
Also, double-check in the same screen that your Session file management cookie path is set to the root folder of your site and that the domain is correct:
Step 3 [also used for multiple store management]
Finally, and this is important, you need to copy the index.php file, .htaccess file, and symlink your media,skin and js folders to your root directory, because they're only available to your subfolder Magento base install right now - we need to let your main domain know where to look for Magento!
From secure shell in your Magento installation directory (in your case, mag) as sudoer:
sudo cp index.php ../
sudo cp .htaccess ../
sudo ln -s js ../
sudo ln -s skin ../
sudo ln -s media ../
Your admin will still be available at yoursite.com/mag/admin.
Edit your index.php file in this main webroot (the file you just copied) and update it around line 45:
$mageFilename = 'app/Mage.php';
Change this to :
$mageFilename = 'cart/app/Mage.php';
Where 'mag' is the subfolder. In your case you'd use the folder named 'mag'. Finally, you need to clear the cache for these changes to take effect.
Step 4: Multi-store [optional]
If you have more than one store, they can all be served this way, but you need to edit the index.php file to give it the correct store code. More info about that can be found here:
http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work
i must say that figuring out how to symbolic link was a hassle and i still couldnt figure it out. All the other steps worked fine except i copied my htaccess and my index.php and i just pasted it to my root. So for those who are having trouble, i found a better solution instead of symbolic link for "media, skin and JS" folders. In your magento admin. System>config under general click web. just change your base skin, media and js to the folder you want them to point to...
ex: {{unsecure_base_url}}cart/skin/
worked for me. Hope it works for anyone with the same problem. Ohh and im using magento 1.8.1 Thanks again #philwinkle

Resources