How to remove /blog from url in Joomla - joomla

I created a Category Blog on my Joomla site but there's a problem. Joomla is adding /blog automatically to urls and as a result, images aren't displayed since blog/images/ doesn't exist. Is there a way to either remove blog/ from urls or correct image links to display /images instead of /blog/images? These are the links:
http://www.gambitchessacademy.com/blog
http://www.gambitchessacademy.com/blog/10-using-time-efficiently-during-a-tournament-game
Thanks very much.

Fist, your real problem is about Relative VS Absolute URLs. See http://kb.iu.edu/data/abwp.html for example.
For example a javascript file on js/jquery.js is a relative URL. If you are on site.com/blog/article.html it will try http://example.com/blog/js/jquery.js. But if you use /js/jquery.js or http://example.com/js/jquery.js you will have your real problem solved.
Note the "/" at start of paths. They make a lot of diference.

Related

Custom URL for Magento's basket page

I'd like to implement custom URL for our Magento's basket. Magento out-of-the-box url paht is /checkout/cart but client request /checkout/bag.
I tried to somehow
* URL rewrite management in backend - it works, but I need to update all occurences in code to new url, because $this->getUrl('checkout/cart') doesnt translate into checkout/bag
* also I tried to follow some advices from http://alanstorm.com/magento_dispatch_rewrites_intro but basicaly it doesnt help me too.
* also I tried example from this post http://phprelated.myworks.ro/two-add-to-cart-buttons-with-different-redirect-actions-at-once-in-magnto/
So, is there any way how can I rewrite translation from path 'checkout/cart' into checkout/bag without updating all ocurrences in our templates and classes $this->getUrl('checkout/cart')
Any solution depending on web server architecture are not the ultimate solution.
I found solution
1) I rewrited model core/url to have desired output
EDIT 1 - sample implementation https://gist.github.com/jaromirmuller/132cdd9378e5b1018170
2) Added url rewrite into config.xml which rewrites url path from /checkout/bag to /checkout/cart
<global>
<rewrite>
<mynamespace_mymodule_checkout_cart>
<from><![CDATA[#^/checkout/bag#]]></from>
<to>/checkout/cart</to>
</mynamespace_mymodule_checkout_cart>
</rewrite>
</global>
3) Added url rewrite into Catalog > URL rewrite management which handles if anyone comes to /checkout/cart then he's redirected to /checkout/bag paht which is correct.
These 3 points makes site consisten and working without any issues. That's the easises way without rewriting tons of templates and classes.
The way Url Rewrites work means that you have some url test.com/some on the page and when you click on it, you'll get test.com/some2 instead. So Rewrites do not change the actual anchor link - they change the destination of that link to the new recipient.
There is no easy solution which will change all of the anchor links to the new ones (aside from parsing and replacing links on each page - which is not preferable).
So if you want to leave anchor links as they are and get the new Url after user clicks on the link, you should go with Url Rewrites. Though if you want to change the actual links on the page, you need to search for all occurrences and change them manually.
Mage::getUrl() is not a fabric which operates with aliases (like Mage::getModel()) - you'll get from it what you have inserted, and the only way to change the outcome Url is to change income parameters.
You can do it using apache url rewrites. Something like
RewriteRule ^/checkout/cart(.*)$ /checkout/bag$1 [R=301,NC,L]
This answer works for changing the wishlist name by changing the frontend routers in app/etc/local.xml. Maybe it can be adapted for your uses?
Change wishlist url in magento
To manage more url translation You can use this module:
http://www.magentocommerce.com/magento-connect/catalog/product/view/id/18160/

Renaming index.php and accessing other pages in Joomla

I have to do some modifications online on my website, and I don't want the users to see those pages. So I renamed index.php to index_orig.php and I put another index.html that show a message (WebSite under construction) for my users.
My problem is that I want to access online to the rest of my pages to check the modifications until satisfaction, but when I try to access the rest of the pages by their whole URL (404 error is shown).
Example : www.mywebsite.com/floder1/pagetarget.php.
Put back index.php.
In your global configuration, set the site to offline and put up a message and a logo etc (assuming you are on 2.5 or 3). You'll be able to login and see the site.
Please keep in mind that in a database driven cms there are not pages in the way that you would think of them in a static html site. Everything gets pushed into the index.php of your template file.
Update the directory default document on whatever webserver you are using. Also update any rewrite rules that may be pointing to index.php

how to transfer codeigniter site from localhost to live server

I developed a site in codeigniter with basic functionality now i want to update this site to my live server. But when i uploaded my site to live server it shows 404 - PAGE NOT FOUND.
http://www.nawtist.com/test/ams/
Please tell me what do i need to do. I searched a lot about this but i didn't found any helpful information. So is there any base_url or anything else that i need to change before upload this on live server really appreciate
And remember, many servers are case-sensitive and with CodeIgniter v3 you should change the controller's first letter file and model's first letter file to upper case. That worked for me too.
Best
You have problem with your htaccess file or mod_rewrite is disable on that server.
When you go to page with index.php it works (although css file doesn't work because of bad routing)
also check if $config['index_page']=''; if it should work without index.php
I had the same problem times ago and there are 4 points in codeigniter to care about as I remember:
Check base_url value in your "config.php"
Check database settings in "database.php"
Check .htaccess file contents if you have defined it once
Check routes.php if you have defined any custom routes
That's all!
If you are facing 404 page not found in Codeigniter after upload file local to live server then follow these steps
change your controller and file name first letter capital
same change as above in model class and file name i.e first letter capital
After following steps above your problem can be solve Thank you.

Joomla: pages not found after copying site to another directory

I have copied a live joomla site. The original is found at [this][1] website. The copied one in found [here][2]. But all links (e.g. in the left navigation menu) result in 404 errors. The administrator backend is accessible and i can create new menu items in the copied one but they all result in 404 errors.
I did adjust the configuration.php file so var $tmp_path var $log_path point the right paths. i updated var $live_site = 'http://hosting01.hestronic.nl/~ijskoud2
The live_site was empty in the original configuration.php file.
Do i still need to run an update or something?
Thank you
PS joomla 1.5.25
Turn off search engine friendly url feature in System -> global configurations.
If you really want to enable SEF URL then you need to set your rewrite base according to your site dir in the server.
For $live_site variable, no need to modify it and keep it empty.
I ran into a similar issue where all of my links were doubling up. Fixed by prefixing http:// to $live_site
You don't need to do anything to $live_site, just leave it blank. The tmp and log paths are the only thing you need to touch. If you have SEF URLs turned on, you will also need to change the rewrite base from / to what ever the subdirectory is.
I disagree with my friend #Brent. Go to your DB to the menu table (by default its called jos_menu) and look for the "path" column. you probably need to manually fix the paths of all your menus to point to the new folder.
Check if the .htaccess file exists in your new folder. if not exists remove the sef url configuration from admin side.

Use relative urls in Joomla menus

I have joomla site which is located in mydomain.com/somefolder/otherfolder/TheSite. I have created a rewrite rule to invisibly redirect all requests beginning with mydomain.com/TheSite to this url. It works fine.
My problem is that the urls that my menuitems point to are the old mydomain/somefolder/otherfolder/TheSite/stuff. If they were relative urls, it would work.
My question: How can I force joomla to use relative urls for the menuitems, or use the urls I explicitly specify?
Thanks in advance
Probably the easiest way to make Joomla produce only relative URLs is to edit the core method "_" of the JRoute class:
JRoute::_()
This is called by Joomla application and extensions to generate consistent URLs.
It is found in:
libraries/joomla/methods.php
Making Joomla spit out relative URLs probably isn't the best way to do it. Making the absolute URLs point correctly would.

Resources