Redirecting Url to Local Host - apache

My website items has pictures which were external links. Now I have bought all the images for those item picture and place into my directory inside a picture folder. I would like to know instead of changing individual item picture link is there a way to redirect old item link to new directory. Example
Old Link:
http://www.something.com/images/item_images/item28.jpg
New Directory Name:
images/item_images
I would like to capture "something.com" and change it with my own website link. like "mywebsite.com/rest_of_the_link". How can I achieve this?

I think you can do this using .htacces file in root directory, seee:
https://my.bluehost.com/cgi/help/htaccess_redirect
http://www.htaccessredirect.net
Or maby using virtual host in apache if you have access to ssh console.
https:// httpd.apache.org /docs/2.4/vhosts/examples.html

Related

How to remove catalog name from url?

I have PrestaShop 1.7.8.7
My application is located in /public_html/home.
I assigned domain to catalog /home, but to access my website I need to use url domain.com/home/ to access homepage.
How do I make it just domain.com?
You'll need to move your Prestashop installation files from the /public_html/home directory and put it everything in /public_html directory.
Then you'll have to change the "physical_uri" value in ps_shop_url database table from /home/ to /
You can either do this directly from DB or from Backoffice in the "Seo&Url" section.
Make sure to save your settings afterwards so a new .htaccess file will be regenerated in the web folder root with correct paths.

Edit Wamp "localhost" page

I wanted to reorganize my Wamp and add a section "My Laravel projects" without adding an extra "index.php" in "www" folder.
After searching and searching, I didn't find any solutions or a folder that contains information/code of the "www" page.
How it looks right now:
How I want to organize it:
Is it possible? Thanks for your help.
You should never amend or add anything to the \wamp\www folder.
Instead, if you add a subfolder like wamp\www\laravelproject or a folder in a completely different folder structure like c:\website\project1\www and then create a Virtual Host for each project. you will then automatically see the new Virtual Host mentioned on the WAMPServer homepage.
See this post for how to easily create Apache Virtual Hosts is WAMPServer

Accessing contents from a symbolic link created in htdocs

We have set up apache server and created a symbolic to logs folder.
Problem:
When we try access the logs using http:/server:port/logs the logs appear properly in browser. However when we are using big ip url that is http:/bigipurl/logs url rewrites as http:/bigipurl:port/logs and the page doesnt get displayed.
Observation:
If we use http:/bigipurl/logs/ logs are getting displayed.
Figured this out, Added directoryslash off under the respective directory section in httpd.conf file.

htaccess http request re-routing

Reason for Problem:
I'm working on a website and wanted to work on it without making edits to the live website. My hosting package allows for "infinite" domains. So instead of editing the live website I create a new domain, without purchasing the domain name and am trying to develop with this new domain.
Issue At Hand:
This issue is that the reference file paths don't work anymore and return 404 when trying to load the webpage. My original website directory structure looks like this
cgi-bin
config
public_html
->JSfiles
->CSSfiles
->PHPfiles
The new one is the same structure however when you open the "temporary web address" the URL looks like this
http://217.199.187.199/myTempAddress.com/"
instead of
http://myTempAddress.com/
so when my index.html file looks for /JSfiles/someJSfile.js its requesting
http://217.199.187.199/JSfiles/someJSfile.js
when it needs to be requesting
http://217.199.187.199/myTempAddress.com/JSfiles/someJSfile.js
Things I've Tried Unsuccessfully:
I would really like to fix this by redirecting with the .htaccess file in the root directory on the server. Ive tried using the following directives with no success.
Redirect /217.199.187.199/JSfiles/mustache.min.js http://217.199.187.199/myTempAddress.com/JSfiles/mustache.min.js
Redirect /JSfiles http://217.199.187.199/myTempAddress.com/JSfiles/
Redirect /JSfiles http://217.199.187.199/myTempAddress.com/
Redirect /JSfiles 217.199.187.199/myTempAddress.com/
Question:
How can I redirect the requests to the right location? I need all the the requests to be of the form http://217.199.187.199/myTempAddress.com/someDir/Somefile.ex
You need to read up a bit more on Virtual Hosting in particular name based virtual hosting.
https://httpd.apache.org/docs/current/vhosts/name-based.html
It sounds like your provider might support name based VHosts but what you're trying to do is not taking advantage of that. To do what you want ie have path that points to a different version of your site is best achieved using mod_rewrite. See this
https://httpd.apache.org/docs/2.4/rewrite/remapping.html
You need to make sure that your provided actually supports this.

change default page in cpanel

What do I need to do to change the default page in cpanel?
Update or create .htaccess file in the public_html folder and make the following content..
DirectoryIndex index.php home.php
If you are referring to the default apache cPanel page then you will need whm access for that
WHM >> Main >> Account Functions >> Web Template Editor
Here you can change the default page, suspended page etc.
Assuming you are referring to the default page when an account is created, this is easily done by creating an index.html or .php page within your /etc/skel folder (assuming you have a VPS or dedicated server).
There is a setting within WHM that allows for it in case you are not CLI savvy.
Hope this helps, sorry for the delayed response, but I'm new and trying to build my rep up!
You can create custom branded login pages for cPAnel and WHM by using the advanced branding features of cPanel. cPanel also supports custom login pages for each reseller's accounts. Linked Below is the documentation.
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/CustomBrandedLoginPages
how to create cpanel default page for hosting domains.
create default html page and upload the files in Skeleton Directory on cpanel root domain.
http://www.motherhost.in/members/knowledgebase/22/how-to-change-default-page-in-cpanel.html
The skeleton directory ( Skeleton Directory: A directory that defines what files and subdirectories new accounts will have by default. When the account is created, the new user’s account will contain an exact copy of the skeleton directory.) exists to let you easily copy the same files into every new account’s public_html and public_ftp directories when the account is created.
Keep in mind that:
When a visitor accesses http://example.com, he will see the contents of example.com 's public_html directory.
When a visitor accesses http://example.com/subdirectory, he will see the contents of public_html/subdirectory.
Contents of the public_ftp directory are available for anonymous FTP users to download.
This WHM feature simply states the location of the skeleton directory (/root/cpanel3-skel).
To set up your skeleton directory:
These files will be accessible to the new user via an FTP client.
Decide what kind of default setup you would like your new users to have.
Place the appropriate subdirectories and HTML files in /root/cpanel3-skel/public_html.
These files will be copied to new accounts’ public_html directories when accounts are created.
Place the appropriate FTP-related files in /root/cpanel3-skel/public_ftp.
These files will be accessible to the new user via an FTP client.