Redirect sub domain requests to look like it's from main domain - mod-rewrite

How do I go about doing the following:
I have a main domain at say http://www.domainname.com
and a another site at http://www.domainname.com/billing/
When loading knowledgebase articles it loads with http://www.domainname.com/billing/knowledgebase.php
I want it to load the content but make it look like it's coming from
http://www.domainname.com/knowledgebase.php
In otherwords anything when I load
http://www.domainname.com/knowledgebase.php*
it should load the content that exists at /billing/knowledgebase.php*
Possible?

It can be achieved with the .htaccess file and the use of mod_rewrite, however I know what you're trying to achieve, and from personal experience I'd say to stop while you're ahead, if you want a root based WHMCS install, then delete it all and start again, by installing WHMCS in the root, rather than a sub-directory. Although WHMCS says to install itself in a sub-directory, a lot of people treat it like a CMS, and as such really want it to be the homepage and content manager of the whole site.

Related

Redirect all requests from xyz.herokuapp.com to new provider

I have moved a website from heroku to another provider. Lets say its custom domain is www.mysite.org. It was also at mysite.herokuapp.com, although we never really used that domain, Google has indexed some pages there. I want to redirect any requests mysite.herokuapp.com/[EVERYTHING] to www.mysite.org/[EVERYTHING]. The paths are otherwise compatible. I am told Heroku does not allow you to use an .htaccess file. I've deleted the mysite project on Heroku but could create a new one thats a simple php page or something else?
I'm sure this has been asked before, i've looked but find either too little or too much information and none seems to answer my question. Thanks.

wkhtmktopdf on shared hosting does not return any data...?

Hi friends currently i m working on a small business project.
for this project i need to convert my dynamic html page into a PDF file..
I googled for html to pdf and found wkhtml...
in my local-host system its works like charm..
But in my shared server it does not gives any output... errors also. when php wrap execute, it fails silently..
Any idea guys??
another thing.. In my shared hosting, they are disabled exec,proc_open and other process related functions, So i used .htaccess file to point another php.ini for reconfiguring the disabled_functions.
Because your hosting provider has disabled the exec methods, I'm sure they won't be pleased to find out you're trying to use wkhtmltopdf. It might be a good idea to contact them about your plans.
When downloading wkhtmltopdf, make sure you grab the right package (based on the server specs). Your best bet is to use one of the static packages as it provides most of the libraries needed to run wkhtmltopdf. You might also need to change the file permissions to be able to execute the file.
Lastly, make sure your custom php.ini is even used by php (calling phpinfo() will do the trick).

why my IgnoreRoute does not work?

I want to prevent users access for my "~/Content/..." folder I wrote it as follow in "Global.asax.cs" and put this line of code at the top of every other routes
routes.IgnoreRoute("Content/{*pathInfo}");
but it does not work. in fact user can see every files in content folder by type the URL in browser.
am I missing something?
How did you figure out that it does not work? Give example.
You may have put it last in the Routing table. So try to move it up so that it gets added to the routing table first. The route collection is an ordered list of routes.
Also try this : Routes.IgnoreRoute("Content/");, but your version of ignore is also correct and it should work.
Lastly, I do not know what you mean when you say the user can see all the contents of the Content folder : Isn't that the point? User must be able to download files from the folder, and we usually just need MVC to ignore the requests from coming into the framework, and so that IIS can directly serve those files.
or did you mean Directory browsing is enabled, and you want to disable that : In that case go to IIS manager, and select your website and look for the Directory browsing option and disable it as shown here.
Your problem cannot be solved by routing constraints. There are 3 significant steps in processing request:
IIS got request.
IIS watch at filesystem and search for direct correspondence to file
If IIS didn't found any file - it gives request to ASP.NET MVC for processing.
So, you need to configure folder security to forbidden direct access to files, but allow access to application, as here.
But I don't recommend to secure folder, that should be shared. I don't believe that your site shouldn't have images to display :) If you have some secured content, you need to create another folder.

Taking over a Joomla created site

So i have a client, who has a disc of an entire site. Root server files, all the way to /httphome/ files...
However, it looks like it was created using Joomla. Now, i know my HTMl and CSS but have never used a CMS like Joomla.
To get this site up and running, am i going to have to install Joomla on my clients server, and then upload the files?
i am going to assume its not that easy.... anyone got any insight into this process and what im looking at?
thanks
Keep in mind that Joomla content resides in a MySql database.
You need the following:
Database export
Create a DB on you MySQL server
Upload the files
Edit configuration.php to work with you db and also set your path there
Also, some components might need some more setup, as some of them have their own cfg files.
To get this site up and running (if the file is really the entire site) should be as simple as setting up a web server and pointing it to the directory with the index in it. Joomla should already be in that file. Let me know if i can elaborate on the process.
Since you are new to Joomla, you might want to try loading the disc contents up on your localhost first. Personally, when I'm trying something new, I hate for my first attempts to be somewhat public - I always feel a little safer if I do the first install someplace local where I'm the only person who can see it.
Best of luck with your project! If you run into any problems, or if you want to confirm that the site is definitely Joomla, let us know and we will get you sorted out.
Do you have the related database? The files that make up Joomla are useless without the database. You could install Joomla and upload your files over the top, but any database changes made by any installed extensions wouldn't be made to that install. You'd also be missing all of the actual site content without the database.
If you do have the database, then all you need to do is import the database in you your mySQL, then upload the files you have on the disc and edit configuration.php file with the new database user and password.

Troubles after installing Two stores with same php docroot

I am trying to setup multiple stores within same hosting account and I studied many interesting guides out there on the matter.
Seems to me I figured out simplest solution for me - map both my dot com sites onto the same directory on host, and modify .htaccess to launch different website depending on URL, like so:
SetEnvIf Host .*anatscraftonia.* MAGE_RUN_CODE="anatscraftonia";
SetEnvIf Host .*anatscraftonia.* MAGE_RUN_TYPE="website";
My first store works fine, but when I go to anatscraftonia.com , all I get always is a Magento 404 page.
I checked all settings, multiple stores are defined and code above is copy/paste from Admin console under Website I added. I have Home page enabled for All Stores and Base URL redefined for both Secure/Unsecure. I also tried changing website to store, with no improvements.
What else am I missing? How do I even know what page is it trying to go to, or whether it even gets “no-route” or just totally whacked…
I threw together some quick and dirty code a few years ago to log the controller dispatch process in Magento Community 1.3x.
http://alanstorm.com/magento_controller_dispatch_logging
I don't think you'll be able to drop those files into a current installation, but it should give you an idea where to stick some logging functions to see why Magento is routing to a 404.
I am not 100% sure what you are trying to achieve but why not use a single instance of magento to handle both stores and magentos own multi store capability..
full details here http://dx3webs.com/front/2010/08/magento-multistore-setup-under-plesk/ post contains links to cpanel instructions as well.
the instructions are for multiple domains but will work with sub folders

Resources