Magento URL issues - magento

I am still new to magento but I have been slowly making progress on replicating the production environment to a sandbox environment.
The issue I am currently running into is that when I go to my site I get a long url rather than a short optimized url. I am guessing it is a configuration setting that I need to change as well as, I went through and had to add index.php to the url string for it to work properly.
What I want to be able to do is use a short url such as /category/page.html rather than catalog/category/view/s/power-tools/id/261/
Thank you in advance!

This is probably because you need to reindex Catalog URL Rewrites. Go to System->Index Management and reindex. (It's probably best to select all and reindex though just to be sure!)

After working through this, I ended up changing the .htaccess Mage::run() settings. I ended up having to change some of the base url setting in the core_data_config table to finish getting everything to work correctly. I also ended up having to set the SEO rewrites (System Config > General > Web > Search Engine Optimization > Use Web Server Rewrites) = No
I found that once index.php was included in the path then my site was working properly.

This is what i ended up doing and it removed the index file as well. Part of the issue is that I installed magento in /store/dir/
1) Login to admin section by using the URL
http://domain.com/index.php/admin
2) then go to “System >> Configuration >>Web >> Search Engines Optimization”
Use Web Server Rewrites : YES
3) Go to “System >> Configuration >>Web >>Secure”
Use secure URL Frontend: YES
** I used the second one **
4)Then create the .htaccess file under your the magento installed folder.
If the magento installed under document root ( /home/username/public_html) then add follogig rules into .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
and If the magento installed under /shop or directory then add the following rules into ” /home/username/public_html/shop/.htaccess ” file.
<IfModule mod_rewrite.c >
RewriteEngine On
RewriteBase /shop/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule >
http://www.bestdesigns.co.in/blog/remove-index-php-url-magento

Related

Codeigniter 3.1.11 unable to open welcome page

I have downloaded and using Codeigniter 3.1.11.
I have copied the same to as usual htdoc folder.
Tomcat is Binary Installed and service running and able to get
the Welcome page with http://localhost/CodeIgniter3111/index.php/welcome.
I have inserted in .htaccess as below.
RewriteEngine On
RewriteCond $1 !^(index\.php|assets|images|js|css uploads|fevicon.png)
RewriteCond %{HTTP_COOKIE} ais=([a-z0-9-_]+)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-f
RewriteBase /CodeIgniter3111/
RewriteRule ^(.*)$ ./index.php/$1 [L]
and also removed the index.php from Config.
$config['base_url'] = 'http://localhost/CodeIgniter3111'; and added the base url as well.
As I type in url (http://localhost/CodeIgniter3111/welcome), I am
getting below error in browser.
Not Found
The requested URL /CodeIgniter3111/welcome was not found on this server.
I appreciate support in advance.
$config['base_url'] = 'https://localhost:8888/Your folder name';
your port number should be there

Codeigniter Project Not Working on localhost

I want to run the codeigniter project which I am currently working on in localhost I setup each and everythng accordingly
$config['base_url'] = 'http://localhost/site';
$config['index_page'] = '';
its works fine in my office but when i bought it home to work more on off days I started getting errors it only shows the home or index page and when i navigate to other pages it displays 404 object not found
just displays the home page all the other routes not working
please help
Reasons can be
You might have copied the code in different CodeIgniter version.
Some code standard differs from version to version.
Might be because of database.
Create .htaccess file and put below code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

Why after downloading my web file offline I need to add index.php?

I wonder what is the difference between my page offline and online?
After downloading my page offline I need to add (index.php) after my folder file in order to make it viewable?
http://localhost/gsaconst/index.php/articles/news
my online page would be
http://www.gsa-constructionspecialist.com/articles/news
How to delete the index.php in the offline page and still make it viewable not error message like:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
you need to add .htaccess file in offline directory
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
and also make sure you remove index.php from config file $config['index_page'] = 'index.php';
find config file application/config/config.php

Heroku PHP cedar stack: can I do URL rewrites?

I'm running a PHP app on the Heroku cedar stack. Is there a way to set up URL rewrite rules? I had hoped to do this in .htaccess files, but only access control directives are recognized in this.
I see that the Ruby advice is to use rake rewrite, but what needs to happen for a PHP app have URL rewrite configuration on Heroku?
You can use a normal .htaccess file with PHP on Heroku. Simply create a .htaccess file with the re-write conditions, similar to this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
This example lifted from WordPress. I believe all urls now redirect to /index.php. Example here: https://github.com/catsby/php-heroku-htaccess and app here: http://php-heroku-htaccess.herokuapp.com/something
So to partially answer my own question and continue what I alluded to in the comments, here's the difference between a Mac and a heroku .htaccess file that I needed to make:
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ $1/$2?arg=$3 #Mac
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ $1/$2.php?arg=$3 #heroku
This is more of a workaround than a solution. I believe the apache versions are different, but in the end I just capitulated on debugging this further and use a .htaccess file with two sections in it that I comment/uncomment.

Magento 404 Error in frontend after upgrading 1.4.1.1 to 1.6.1.0

I upgrade my magento store 1.4.1.1 to 1.6.1.0 following instruction from this link. Upgrade was successfully done. My Magento backend is working fine. But while I checking front end I got 404 error.
I tried various advice in Google. But none of them helps me.
If you have previous experience in this please share.
Edit :-
I think this problem is occurred due to multi store setup.so i share two table structures
core_store
core_store_group
Core_website
I found the problem myself:-
In "core_store" table some of the stores was disabled.While activate the all stores the problem is solved.
Clean the cache, rebuild catalog url rewrite index, check .htaceess and mod_rewrite
I had this same problem recently.
Check to see if any modifications of the root index.php file have been overridden by the upgrade.
You probably updated the $mageRunCode depending on what url you come to the site on, this will have been replaced by a default index.php file with the upgrade.
i have similar problem and i tried all solution above and also from google but its not solve the problem in the end i tried one solution that is in .htaccess file in root directory
############################################
## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>
#########
i just comment the above line like
#RewriteRule .* index.php [L]
and then add this code
####
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /magento/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
this will fix my problem and then all categories page and products page are opening perfect and no more 404 error or forbidden error comes. just posted it might be its help others

Resources