How to give www.domain.tld its own seperate folder? - redirect

I would like to try something.
I wanted to have on http://domain.tld/ a Multiuser Wordpress Install and on http://www.domain.tld/ a Link Directory.
As of now, the easiest way to go seemed like seperating www from non-www while putting the www in its own folder and haveing somewhere in the non-www version a clean redirect that in case someone opens the plain http://domain.tld, s/he would het redirected to http://www.domain.tld/ .. while users who open http:domain.tld/wp-admin would end up in the wordpress Login/Dashboard
Is there any idea you could give me how to seperate those two url's?
SOLUTION for WHM/cPanel Server
As I am not fond with console commands/navigation, I have used for everything WinSCP.
You might want to create a Testsubdomain if there is none.
locate this folder /var/cpanel/userdata/username where "username" is the username for the Account.
You will find several files like
domain.tld.cache
domain.tld
cache
main
main.cache
testsubdomain.domain.tld.cache
testsubdomain.domain.tld
Nearly all of them need to be edited. Download them all and edit them in an editor like Notepad++ .. rename testsubdomain files to www.domain.tld and www.domain.tld.cache .. Edit www.domain.tld like this
---
documentroot: /home/USERNAME/public_html/www
group: USERNAME
hascgi: 1
homedir: /home/USERNAME
ip: XX.XX.XX.XX
ipv6: ~
no_cache_update: 0
owner: root
phpopenbasedirprotect: 1
serveradmin: webmaster#www.domain.tld
serveralias: www.domain.tld
servername: www.domain.tld
usecanonicalname: 'Off'
user: USERNAME
userdirprotect: ''
do the same in www.domain.tld.cache.
Edit all other files and check that you change everywhere the testsubdomain to www .....
Upload everything and well, I simply had to wait just a wee bit (30 minutes where I was still looking for a solution) and it worked perfectly!
I could use the Wordpress Plugin "Eggplant 301 Redirects" to create with the Plugin an 301 Redirect from http://domain.tld to http://www.domain.tld/ that works like a charm.
Problem perfectly solved in my opinion a perfect manner :) ... all by myself :P ... I just have to update the places where I had asked for some intel/help in the Problem solving..... Strange that I didn't got some, but maybe its just too odd :)

Well, I have updated my initial Question, so that it no longer really is a question, but an answer too.
Took me quite some time, lots and lots of searching, finding breadcrumps and in the end it could have been solved already at least 4 hours ago sigh (In my first trys I had messed around in the DNS Entries, removed the default created entry for www and changed it from a CNAME record to an A record and that seemed to have caused the problem that my changes were not properly executed and only after I had terminated the account and recreated, uploaded the already long time edited files via SCP again, it worked) ... but in the end it is done
Thank you all for reading and I truly hope that this might help also someone else.

Related

SIP extention created by FusionPBX can not login into softphone

I have a FreeSWITCH v1.6.13 on my Debian 8( From git) and it is OK.
After that i installed the last FusionPBX to manage my PBX telephony FS.
But it gives me error : 403 You must define a domain called x.x.x.x in your directory...
Both i installed by FusionPBX guid in their web site.
FreeSWITCH and FusionPBX.
Im going crazy cause about 4 days i Am working and not a good result yet.
I know Fusion store data in DB and i give him a Pgsql user name and password.( not the default one it suggest after ./install command) and also FS with --enable-core-pgsql-supprt in ./configureaiton with -C.
And i searched a lot, and all says as this link.
But when i go to sip status from FusionPBX, it says that my ip is correct, and also i did what they say but no success.
Just one time it worked! and i did not why it work.
And after it does not work and again says 403 you must ....
And after that i create an extention, i go to FS terminal and type user_exist 101 (user i created in fusionpbx)it return me false.
Can it be DB issue?
I do not know why just one time it worked and after i after that again gave me 403 error.
Cause i did changed a lot i could not understand what was the cause to work it.
Is it a bug?
What exactly i am doing wrong??
Really any help will appreciate.
EDIT 1 :
My softphone is android zoiper for test the created extention in fusion.
Make sure you are using the "Extension" number as the username in zoiper. Also go to the extension's settings page to see the current password for that extension. I have used Zoiper on my android phone with FusionPBX. So I know it will work.
Zoiper account settings will be:
Account Name: Any name.
Hostname: ip/hostname of FusionPBX
Username: extension number
Password: extension password.
One thing that confused me a lot when I first tried fusionpbx is the "Users" vs "Extensions". From what I can tell "Users" are only for logging into the web UI of FusionPBX, for things like checking voicemail and managing other features. The "Users" are not SIP users.

Magento: Add New Product Form not displaying in Admin

I've just installed the magento and when I tried to add new product from admin,But now product form is not being displaying. I can see the page like this
what should I do? Please, I searched through Google, but, couldn't find any appropriate answer.
Have you already tried to clear cache and cookies? also some times you have to do it on the shell on /path/to/my/magento/folder/var/cache just run "rm -fr *".
If that doesn't work you can check you files ownership and permissions (the http service has to have the write write permissions an ownership on the files and folder - http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions).
Hope that works for you.
You could try enabling display_errors in index.php i.e.
ini_set('display_errors', 1);
Also you could enable logs in your backend, and check for errors in system.log and exception.log
As Magneto's back end makes heavy use of prototype.js, check your console for errors .

Setting moodle online

Good day everyone, I have been trying to put my moodle online so pcs from internet can access it, but until now, no luck at all. (Im using moodle 2.3.2 on Windows Server 2008 and IIS 7).
I tried to configure the moodle file config.php, setting the directive $CFG -> wwwroot = "my-public-ip/moodle". Then, when I access to moodel from the server, I can access it by "http://my-public-ip/moodle", when I try to access via localhost, it sends an error which it is OK.
But the funny part comes when I try to access the server from an outside pc. When I type "http://my-public-ip/moodle" it simply cant "see" the configuration I made to the config.php file (it says: This server cna only be accessed via localhost/moodle) it looks like the outside pcs are either ignoring it, or searching for another configuration file. I dont know what the hell is happening, this is very odd.
Any ideas?? tnx!!!
Change the following file:
lib-->setuplib.php
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 3);
for
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 0);
I realise this is an old question, but it's also worth pointing out you may need to also run the database search and replace script, at:
http://my-public-ip/moodle/admin/tool/replace/index.php
as referenced in Method 2 here.
This is required if you change the name of the site once you have installed it. If you were already using Moodle under "localhost", then there will be a number of references to the old localhost address stored in the database that need to be updated to the new IP-based address.
It might be because the http:// part is missing?
$CFG->wwwroot = "my-public-ip/moodle"
should be
$CFG->wwwroot = "http://my-public-ip/moodle"

base url redirecting for absolute urls

I'm dealing with an annoying problem. I have to make some changes to a large website, which source code is not under my control (sub-contracting). As usually I try to rebuild a local copy of the site to test my changes. The problem is now that almost all paths used in URLs for images, css, links etc. are relative paths pointing to the root directory, like
href="/style/main.css"
This is a problem because I develop on an intranet server and I put this project into a nested directory, so the URL to the project files is sth. like
http://myIntranet.com/checkout/project
What happens is that the paths from the first example don't resolve correctly. So I tried using the base tag to set the directory from which links should be resolved as
That works fine when the path is
href="style/main.css"
without the slash at the start, but fails when the slash exists, because (I think) the link is resolved from the server host, not from the URI in the tag.
So... is there any possibility to make the "/dir/file.html" links resolve from a root othe than the server root? Or do I have to manually remove all prepending slashes from the paths (urgh)?
Thanks in advance. :)
If you're doing local development on a web site you can do either of the below. Both involve moving your project in a base folder instead of working with sub folders inside your document root.
Virtual host on different port
In your web server, create another listening port and virtual host.
After restart, you can access your web server as http://localhost:81 or whatever port number you choose.
Virtual host on same port
Only create another virtual host (like above), but make sure to use named virtual hosting.
After restart, you have to add another entry in your hosts file (c:\windows\system32\drivers\etc\hosts or /etc/hosts) using a simple text editor:
127.0.0.1 localhost myproject1.self.com
The above line should already exist, so you can keep adding more names to it:
127.0.0.1 localhost myproject1.self.com myproject2.self.com
Personal preference
I like the second option, because I don't have to mess with ports and stuff like Facebook API keeps working as you expect.
I hope this all makes sense, let me know otherwise.

Can anyone help - I can't get a Testcontroller to route/display in my browers - zend framework?

can anyone help me with this ?
i'm following a zend framework tutorial http://www.youtube.com/watch?v=BOwSfKXKpZQ quickstart (2) I seem to have everything working ok and have craeted a new project called square and can acceess the index page ok - "http://127.0.0.1:8888/square/".
I have also created a new controller called Test , but when i try and access it - "http://127.0.0.1:8888/square/test" i get a 404 error ?? i've tried to solve this but cant seem to get anywhere ??
looks easy on the tutorial !
im using EasyPHP as my testing server.
thanks in advance
It looks like you've dropped your Zend project in the "square" directory, which will work for the index controller but other routes will not match. The "/square/test" route is most likely looking for SquareController::testAction.
What I didn't see at the beginning of that youtube demo is where he set up the virtual host. I'm not familiar with EasyPHP, so there might be an easier way to do it, but you can give your site a local name, we'll call it "square.local", and then you don't have to include the square prefix in the url.
VirtualHost Config:
<VirtualHost *:8888>
ServerName square.local
DocumentRoot /path/to/www/square
</VirtualHost>
Also add square.local to your windows hosts file (C:\Windows\system32\drivers\etc\hosts):
127.0.0.1 localhost square.local
Now you can go to http://square.local to get to IndexController. http://square.local/test to get to TestController, etc.
To start: in applications/configs/application.ini, set
resources.frontController.params.displayExceptions = 1
so that the 404 page can report what module/controller/action the system thinks is being requested.