cakephp with url different from server to server - url

this is my problem.
on my pc (wamp) if i click on a link that use an $id var, it goes to the right page and the link is already right (like (index.php/prenotation/1).
i uploaded my site to bytehost site, and if i click on the same link, it is wrong (index.php/prenotation) without the final $id.
I don't think it is something about the host type.
Thanks for help.

Related

Tricky redirect/rewrite

I searched for this one, but found nothing ...
My old site is: cs.abc.edu/~cs4096
My files were at: cs4096#cs.abc.edu/public_html
My personal site: myname.com
My Github Pages site: myname.github.io
When a user requests cs.abc.edu/~cs4096 they are served cs.abc.edu/~cs4096/index.html and so on.
Via the ISP hosting myname.com, I setup a CNAME pointing teaching.myname.com to myname.github.io .
I want references to the old site, including pages below the top index.html, to be sent to teaching.myname.com where through the magic of DNS CNAME the URL goes to the myname.github.io site. In other words, users still go to the cs.abc.edu/~cs4096 but they are served from github.io.
The teaching.myname.com -> myname.github.io bit is working fine. It’s the initial redirect/rewrite that is failing. The problem is that the ~cs4096 is included in the URL when it is passed to myname.com .
That is, this
http://cs.abc.edu/~cs4096
ends up as
http://teaching.myname.com/index.html~cs4096
instead of
http://teaching.myname.com/index.html
and this
http://cs.abc.edu/~cs4096/Schedule
ends up as
http://teaching.myname.com/index.html~cs4096/Schedule
instead of
http://teaching.myname.com/Schedule
And, if you wonder WHY I’m doing two “redirects” here, it is because want the automatic rebuild of github pages that I can’t get at abc.edu or myname.com .
Thank you all
Never mind ... I abandoned this idea and used an HTML Redirect. It will mess up “Back” in the Browser, but it works.

Get error when trying to access my link

I've just started to learn HTML and I did my first website. Inside on the "Home" button I put a normal link who go to www.google.com, in my local file in the computer is working OK but after I update on the web host and I click it I get an error The requested URL /idevelop.org/http//:www.google.com was not found on this server.
This is my web site http://idevelope.tk/ try even you, and tell me what I am doing wrong. I know is not the best one but is my first one after 3 days of learning, so don't be bad.
Thank you very much for your helping.
If you want "home" button click to visit any URL,The hyperlink tag should have URL http://www.google.com instead of http//:www.google.com

localhost.com redirects to google search

I am eager to know why localhost.com (without www) redirects to google.com. I also noticed that www.localhost.com gives a 404 page not found. I checked this in Firefox, Chrome and Internet Explorer all does the same. I checked the domain name records and it shows it belongs to Tucows and I am pretty sure Google doesn't own it and I know we can use http redirect to change it to a www or non-www version as the site owner wishes.
Interesting answer posted by Ken Watford, Google employee: http://www.quora.com/Why-does-http-localhost-com-redirect-to-Google
He claims someone bought the domain when the web was still young and kept it ever since, but he does not say who.
It looks like others have had the results as you, check out the links below.
Try here:
http://answers.yahoo.com/question/index?qid=20111105050333AATP1r5
or here:
http://forums.phpfreaks.com/topic/146474-localhost-redirects-to-googlecom/
I think localhost.com should be owned by google as I tried pinging it and it showed the ip of google.com.I still don't know why the DNS records shows tucows as the owner.
I have been searching this from long and finally i found complete solution after going through different answers.
As far as #pradeep's answer is concern, he is right that localhost.com is purchased and points to particular IP so it is redirecting.
But we can override domain names in Windows platform for our local development PC via hosts file residing in C:\Windows\System32\drivers\etc as per #Faysal's answer.
Open hosts file as administrator and enter following line
127.0.0.1 localhost.com
But doing such also did not solve my problem. So i found final solution which will work in chrome browser.
In chrome you have to clear all dns cache via opening following url
chrome://net-internals/#dns
And here clear all cache and finally you will be redirect localhost.com to your local server's home page.
If you are using the Windows platform, then go to your %windir%\System32\drivers\etc and copy the host file to %userprofile%\Desktop. Open it with any text editor and remove the # sign from the front of 127.0.0.1 localhost. Save it and paste it back. Check if the problem is solved.
localhost.com is a website. It does not point to your local IP, instead it most likely has an A record pointing to Google's IP. It practically is Google, and I can prove it.
When the site worked if you connected using HTTPS then it would give a certificate error, the reason being that the certificate is signed to google.com but localhost.com is connecting.
I think the site has now been removed though.... I hope that solves it. It can cause some confusion since localhost points to 127.0.0.1.

Drupal 7: URL alias is getting ignored on pages when "provide a menu link" is unchecked on multilingual site

I'm hoping someone can help me because this is driving me crazy.
I have a multilingual DrupaL 7 site set up with English being the main language and French being the secondary language. I have url aliasing set up and for the most part it works correctly.
The problem arises when I have pages that I don't want included in a menu, so I leave the "provide a menu link" box unchecked. Even if the "Generate automatic URL aliases" box is checked for those pages without a menu link, the page completely ignore any url alias patterns I have set up and the url always shows up as 'node/31' instead of 'my-content-page'. If I hardcode in a URL alias via the URL path settings on the page, it WILL take those, but this is not what I want. I want it to take the url alias pattern I've set up for it. I even installed the "Pathauto persistent state" module and forced the "Generate automatic URL aliases" to remain checked just in case, but my alias patters are still ignored.
Both English and French pages do this if the page is not provided a menu link.
Has anyone seen this behaviour before? Does anyone have any ideas what might be wrong?
Thanks!
This can happen when you have tokens in your URL alias pattern that doesn't work for any reason. In your case it sounds like you have a pattern including a "menu item" token, so when you save your node without a menu item, the URL alias is not created.
The solution would be to either include a menu item, manually add your URL alias, or change anything looking like [node:menu-link] in your URL alias patterns to something else.
I think I had the same problem, and the point was that the "Basic Page" content-type needed to have available the menus of the appropiate languages in its "menu settings" (in admin/structure/ then "edit" basic-page) .
Hope this will work for you too.
If your have a non english site, follow the issue: https://drupal.org/node/1847444 and patch or solution.
I had the same problem and I solved it, "I hope forever", by reading the comment written by enzipher:
This can happen when you have tokens in your URL alias pattern that
doesn't work for any reason.
I'm using a custom pattern and I solved it by following these steps:
I went to pattern page, deleted custom token and save
I went to node and edit, then saved the node and url alias had been created like domain/language/title_node
I went to pattern page, insert same custom token and saved
I went to node again and edited it, then saved and the correct node url alias has been created
domain/language/custom_token_content/title_node

working on port 81(wampserver)

I have recently installed wampserver 2.0 and configured it to work on port 81. Now the problem is that when I click on phpMyAdmin present at the taskbar inside wampserver 2.0 the browser redirects me to
localhost/phpmyadmin instead of localhost:81/phpmyadmin. When I manually type it, everything works fine.
How can I fix this thing? I want the browser to open localhost:81/phpmyadmin page instead of localhost/phpmyadmin when I click on phpMyAdmin.
The configuration is stored in wampmanager.ini, located in the wamp installation directory.
This file is generated from wampmanager.tpl though, so you need to change the following line there:
Type: item; Caption: "${w_phpmyadmin}"; Action: run; FileName: "${c_navigator}"; Parameters: "http://localhost/phpmyadmin/"; Glyph: 5
You can even add your own menu items in there if you like.
You need to restart Wamp after changing this configuration, since wampmanager.ini needs to be re-generated.
If I'm understanding you correctly, the problem is that your link to phpMyAdmin points to the wrong direction. Now I've never used this server, but the wampserver's taskbar is probably some HTML file. Just look for something like <a href="http://localhost/phpMyAdmin/"> and replace the HREF with your path there.
Wherever possible, you should use relative links in your website. I don't know anything about this "wampserver", but the link to phpmyadmin, instead of being <a href="http://localhost/phpmyadmin">, should be <a href="/phpmyadmin">, and that way it will continue to work no matter what port or domain you're running on.
Added :8080 to all 3 http://localhost uses in wampmanager.tpl. Saved changes. Exited wampserver. Started Wampserver. Came up green. Clicked localhost inside wampserver menu. Wampserver page opened in browser.
Thank you Peter Lang for your post. It led me to solution I've struggled with for several days.

Resources