Homepage Loading As Index.php - .htaccess

I'm new to prestashop, I had made few changes to the .htaccess now my homepage isn't loading. Whenever i try my domain name it shows the index.php page
Please, somebody help me. I have tried to re-generate the .htaccess file but was of no use.
Cheers,
AG

Related

Remove directory on dynamic links with .htaccess

I wrote the following codes with .htaccess
RewriteRule ^articles/([0-9a-zA-Z-_]+)$ page.php?article_seolink=$1 [NC,NE,L]
And I created the following URL address
example.com/articles/article-title
But I want to create a link like
example.com/article-title
How can I do this and redirect old URL to new one?
With your shown samples, please try following rules. Please make sure to place your htaccess Rules file inside articles folder. Please make sure to clear your browser cache before testing your URLs.
RewriteEngine ON
RewriteRule ^([0-9a-zA-Z-_]+)$ page.php?article_seolink=$1 [NC,NE,L]

Rewrite URL in .htaccess - PHP

I have a problem with .htaccess file and code in that file. I create a simple CMS using PHP. In Fron-End users can view listed products and buy the same. Where is the problem? The problem is when listed product on localhost/site3/index.php and the open random product you can view all information about that project, but when the user opens category products/protection-program/inspection-gloves/index.php and on that page click on a random product then user get an error The requested URL was not found on this server. How to generate .htaccess file to support the next URLs.
My .htaccess file:
RewriteEngine On
RewriteRule ^([0-9A-ZA-Z-]+)$ details.php?pro_id=$1 [QSA,NC,L]
File details.php write-in .htaccess the file is stored into localhost/site3/details.php. In that file is written code for preview all product information.
I try next:
Copy and Paste details.php file into localhost/site3/products/protection-program/inspection-gloves/details.php and then open some products listed in that category, but won't work.
Change RewriteRule ^([0-9A-ZA-Z-]+)$ details.php?pro_id=$1 [QSA,NC,L] to RewriteRule ^([0-9A-ZA-Z-]+)/([0-9A-ZA-Z-]+)/([0-9A-ZA-Z-]+)$ details.php?pro_id=$1 [QSA,NC,L]. With this change when open random product stored on next URL localhost/site3/products/protection-program/inspection-gloves/ i get automaticly redirection to localhost/site3/index.php. Don't know reason.
Note: I have some products with less or more categories/sub-categories...
I want to generate .htaccess to support all my URLs. Any advice or help will be helpful. Thanks all!
I find the solution.
On existing code in .htaccess file add next code:
RewriteEngine On
RewriteRule ^products/category/subCategory/([0-9A-ZA-Z-]+)$ details.php?pro_id=$1 [NC,L]
With that code, I resolve my problem.

Rewrite invisible with Apache .htaccess

I'm a newbie in writing .htaccess file and even after 3 hours of tutorial, I still can't achieve what I want...
Hope you could help me :) ! :
FIRST I need to redirect my website http://www.runnincity.com to http://www.runnincity.world
To do so, I wrote a .htaccess file located to the root of runnincity.com with the code :
Redirect permanent / http://www.runnincity.world/
This is fine.
THEN I need http://www.runnincity.com/blog to be reachable through the URL http://www.runnincity.world/blog but I don't want the rewriting to be visible for the user. So if the user write http://www.runnincity.world/blog, the URL must stay as it is but display the content of www.runnincity.com/blog .
I wrote a new .htaccess located in the root of runnincity.world with the code below (but doesn't work) :
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^runnincity.world/blog$ runnincity.com/blog [P]
I feel completely lost ... thanks for your help !

How to set the default website page through htaccess?

I am currently setting up a website from a client on his hosting account. The website address and for some reason doesn't default to .php files (that is: index.php). If I put index.php and there is no index.html file I receive the following error:
If you feel you have reached this page in error, please contact the
web site owner: someemail#example.com If you are the web site owner,
it is possible you have reached this page because: The IP address has
changed. There has been a server misconfiguration. The site may have
been moved to a different server. If you are the owner of this website
and were not expecting to see this page, please contact your hosting
provider.
His hosting is a shared hosting on cpanel.
Use the DirectoryIndex directive in your .htaccess file
DirectoryIndex index.php
The problem was caused by my web-browser cache, as soon as I have cleared my cache it worked!
Try
DirectoryIndex index.php
if that doesn't work you might have to work around it by providing index.html like
<html><frameset rows="*"><frame src="index.php"></frameset></html>
(ofcourse more elaborate)
You can set your default page as the directory index using .htaccess file in 2 ways.
First method
DirectoryIndex yourfile.php
Above code will set 'yourfile.php' as the directory index. But this will applies to all sub folders as well and may occur '404' error for some related urls.
Second method
Use this code to set your handler file for the root directory
RewriteEngine on
RewriteRule ^$ /yourfile.php [L]
If you want to set a handler file for the sub folder, use this one
RewriteEngine on
RewriteRule ^subfolder/$ /yourfile.php [L]
enter image description here
im getting this error...
enter image description here
i found this line in index.php
how to remove this defualt page and make my website live

.htaccess for cakephp

I am runing a site wishberry.in on cakephp framework. I had some dirty URLs previously and now i want them to cleanup through .htaccess
I original url was wishberry.in/createwishlist3 and i want to change that to wishberry.in/brands with a 301 redirect.
The reason for using 301 is, if someone type wishberry.in/createwishlist3, the page will take them to /brands automatically.
Can anyone help me out what to write in my .htaccess file.
I would recommend doing this with routes in CakePHP rather than the .htaccess file. See http://bakery.cakephp.org/articles/Frank/2009/11/02/cakephp-s-routing-explained for more details.
The following should do the trick:
RewriteEngine On
RewriteRule ^createwishlist3$ /brands [R=301,L,NC]
Hope this helps.

Resources