Jump to content

[Solved] how to remove url-rewriting for home page / index.php


Recommended Posts

I am using Prestashop 1.4
I went to Preferences>Seo&Urls;. and I edit my index.php
and it that field, I fill "rewritten url as "home".

now my website home page link become like www.mywebsite.com/home
I just want it to be www.mywebsite.com
I tried to empty the "rewritten url" field, but it doesnt save.

what should I do?

Link to comment
Share on other sites

Have you tried to regenerate .htaccess? You can do this at Tools - Generators tab

I tried to empty the “rewritten url” field, but it doesnt save.

If that doesn't work. You can try to remove it from database directly via database tool.
Link to comment
Share on other sites

Have you tried to regenerate .htaccess? You can do this at Tools - Generators tab

I tried to empty the “rewritten url” field, but it doesnt save.

If that doesn't work. You can try to remove it from database directly via database tool.



I have tried to regenerate .htaccess, but nothing has changed.
what do I have to do with my database?
Link to comment
Share on other sites

I have tried to regenerate .htaccess, but nothing has changed.
what do I have to do with my database?


If you can not change it via you back office admin.
You can change it from database directly. You can use database tool like PhpMyAdmin

look into table

ps_meta for the id_meta of index.php page
then look into table ps_meta_lang to find the records related to index

then manage to delete the url_rewrite field
  • Like 1
Link to comment
Share on other sites

I have tried to regenerate .htaccess, but nothing has changed.
what do I have to do with my database?


If you can not change it via you back office admin.
You can change it from database directly. You can use database tool like PhpMyAdmin

look into table

ps_meta for the id_meta of index.php page
then look into table ps_meta_lang to find the records related to index

then manage to delete the url_rewrite field


Nah.. know it works, thanks for helping shokinro..
Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...
  • 8 months later...
  • 11 months later...

if you're using ps 1.6 then you have to go to Preference > SEO & URL. There you scroll down below until you find Set Up URLs tab. Set to Friendly URL and leave the other as it is. For user with Mac or Linux, you have to create an .htaccess file in the root folder of PS installation and set the permission to read & write (chmod 777). If you've done that, than save. You will get the .htaccess file with the code similar to this.

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

Hope it helps

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...