Jump to content

How to add Wordpress to Prestahop URL as a Directory


Recommended Posts

I have a website up and running using Prestashop 1.4X and would like to set up a directory for a blog.

 

I.E. www.mywebsite.com.my ---> www.mywebsite.com.my/my wordpress blog

 

I added the directory but when I try to access blog using /wp-adim I'm redirected to the homepage of my Prestashop.

 

Any help and or suggestions would be welcome.

 

Thank you,

 

Phil (Malaysia)

http://www.kidstoysmalaysia.com.my

Link to comment
Share on other sites

Thanks for your suggestion. I'm at a loss on how to search or edit ,htaccess files. I've cut and paste my .htaccess file contents could you or someone help me to change/edit the file to allow access to a directory such as " http://www.kidstoysm...sia.com.my/baby strollers malaysia " Please note I would like to have wordpress blog located in the /baby strollers malaysia directory.

 

Thanks,

 

Phil

 

The .htaccess file contents are below.

 

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE

# http://www.prestashop.com - http://www.prestashop.com/forums

 

# Do not remove this line, otherwise mod_rewrite rules will stop working

#RewriteBase /

# URL rewriting module activation

RewriteEngine on

RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$

RewriteRule .* - [F]

RewriteBase /

Options +FollowSymLinks

# URL rewriting rules

RewriteRule ^([a-z0-9]+)-([a-z0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2$3.jpg [L,E]

RewriteRule ^([0-9]+)-([0-9]+)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2.jpg [L,E]

RewriteRule ^([0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*).jpg$ /img/c/$1$2.jpg [L,E]

RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [L,E]

RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [L,E]

RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E]

RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$2$4 [L,E]

RewriteRule ^([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$1$3 [L,E]

RewriteRule ^([0-9]+)-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]

RewriteRule ^content/([0-9]+)-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]

RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]

RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]

RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]

 

# Catch 404 errors

ErrorDocument 404 /404.php

Options -MultiViews

<IfModule mod_rewrite.c>

 

# Disable Multiviews

Options -Multiviews

 

# URL rewriting module activation

RewriteEngine on

 

# URL rewriting rules

RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg [L]

RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg [L]

RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$1$2.jpg [L]

RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$1$2$3.jpg [L]

RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg [L]

RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg [L]

RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg [L]

RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg [L]

RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$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])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg [L]

RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L]

RewriteRule ^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$ /img/c/$1.jpg [L]

RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L]

RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]

RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]

RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+ /category.php?id_category=$1&noredirect=1 [QSA,L]

RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$1 [QSA,L]

RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*) /supplier.php?id_supplier=$1 [QSA,L]

RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*) /manufacturer.php?id_manufacturer=$1 [QSA,L]

RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$1 [QSA,L]

RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,L]

RewriteRule ^page-not-found$ /404.php [QSA,L]

RewriteRule ^address$ /address.php [QSA,L]

RewriteRule ^addresses$ /addresses.php [QSA,L]

RewriteRule ^authentication$ /authentication.php [QSA,L]

RewriteRule ^best-sales$ /best-sales.php [QSA,L]

RewriteRule ^cart$ /cart.php [QSA,L]

RewriteRule ^contact-us$ /contact-form.php [QSA,L]

RewriteRule ^discount$ /discount.php [QSA,L]

RewriteRule ^guest-tracking$ /guest-tracking.php [QSA,L]

RewriteRule ^order-history$ /history.php [QSA,L]

RewriteRule ^identity$ /identity.php [QSA,L]

RewriteRule ^manufacturers$ /manufacturer.php [QSA,L]

RewriteRule ^my-account$ /my-account.php [QSA,L]

RewriteRule ^new-products$ /new-products.php [QSA,L]

RewriteRule ^order$ /order.php [QSA,L]

RewriteRule ^order-follow$ /order-follow.php [QSA,L]

RewriteRule ^quick-order$ /order-opc.php [QSA,L]

RewriteRule ^order-slip$ /order-slip.php [QSA,L]

RewriteRule ^password-recovery$ /password.php [QSA,L]

RewriteRule ^prices-drop$ /prices-drop.php [QSA,L]

RewriteRule ^search$ /search.php [QSA,L]

RewriteRule ^sitemap$ /sitemap.php [QSA,L]

RewriteRule ^stores$ /stores.php [QSA,L]

RewriteRule ^supplier$ /supplier.php [QSA,L]

</IfModule>

 

# Catch 404 errors

ErrorDocument 404 /404.php

 

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType image/gif "access plus 1 month"

ExpiresByType image/jpeg "access plus 1 month"

ExpiresByType image/png "access plus 1 month"

ExpiresByType text/css "access plus 1 week"

ExpiresByType text/javascript "access plus 1 week"

ExpiresByType application/javascript "access plus 1 week"

ExpiresByType application/x-javascript "access plus 1 week"

ExpiresByType image/x-icon "access plus 1 year"

</IfModule>

 

FileETag INode MTime Size

<IfModule mod_deflate.c>

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE text/javascript

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

</IfModule>

Edited by Phil_Malaysia (see edit history)
Link to comment
Share on other sites

that first section in your .htaccess does not look like the typical entry from prestashop. Honestly I am not sure if this is the problem but I do believe it is. You have a rule that performs "RewriteBase /". This is looking at any request coming to the root of your website and possibly changing that to something else. I don't see anything rewriting /blog specifically, so maybe if the URL is not found, it redirects to your shop by default.

 

You can edit the .htaccess file using an FTP client or your control panels "File Manager". I would try to rename the .htaccess file to something else, like .htaccess_old. Then try navigating to your word press and see if you can. That will tell us if it is in fact the .htaccess file. After the test is complete, rename the file back to .htaccess and report back here with the results.

 

# Do not remove this line, otherwise mod_rewrite rules will stop working
#RewriteBase /
# URL rewriting module activation
RewriteEngine on
RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$
RewriteRule .* - [F]
RewriteBase /
Options +FollowSymLinks
# URL rewriting rules
RewriteRule ^([a-z0-9]+)-([a-z0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)-([0-9]+)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2.jpg [L,E]
RewriteRule ^([0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*).jpg$ /img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ /product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]

Link to comment
Share on other sites

Hi,

 

I have not set up the Wordpress blog yet. The path to set up the blog would be

 

http://kidstoysmalaysia.com.my/baby-strollers-malaysia/wp-admin

 

When I try to go to this link I'm then redirected back to the root.

 

I do have redirects set up for the site. The are 301 "no redirect". I've pasted the code below. The "hosting URL" is kidztoyz.biz, kidstoysmalaysia.com also should point to the ".com.my" URL.

 

Thanks,

 

Phil

 

rewriteengine on

rewritecond %{HTTP_HOST} ^www.kidztoyz.biz$ [OR]

rewritecond %{HTTP_HOST} ^kidztoyz.biz$

rewriterule ^$ "http\:\/\/kidstoysmalaysia\.com\.my\/" [R=301,L] #4fc6fecbe5a56

rewritecond %{HTTP_HOST} ^www.kidstoysmalaysia.com$ [OR]

rewritecond %{HTTP_HOST} ^kidstoysmalaysia.com$

rewriterule ^_sites\/kidstoysmalaysia\.com\/$ "http\:\/\/kidstoysmalaysia\.com\.my\/" [R=301,L] #4fc95b4416a2a

rewritecond %{HTTP_HOST} ^kidstoysmalaysia.com.my$

rewriterule ^_sites\/kidstoysmalaysia\.com\.my\/$ "http\:\/\/www\.kidstoysmalaysia\.com\.my\/" [R=301,L] #4ff3cfb0aca65

rewriterule ^(.*)$ "$1" [R=302,L] #5019b9ab6b668

Link to comment
Share on other sites

bellini13 I managed to resolve the WordPress issue. I've actually created a few blogs for individual department managers. They are

http://www.kidstoysmalaysia.com.my/baby-strollers-malaysia

http://www.kidstoysmalaysia.com.my/fisher-price-malaysia

http://www.kidstoysmalaysia.com.my/philips-avent-malaysia

http://www.kidstoysmalaysia.com.my/baby-and-children-cloths-malaysia

 

each blog is assigned to a different department manager.

 

Again thank you for your time.

 

I didn't think the two applications would intergrate and would have ended up creating new site for the blogs and loss the SEO advantages.

 

Now my worry is future bandwith if/when traffic picks up.

Link to comment
Share on other sites

Hi Sapling Design,

 

My problem was with the folders and redirects. I use Go Daddy hosting and they set up the WordPress for me.

The process I used was as follows:

 

I created folders for each blog that I wanted to create.

I then installed WordPress into each folder using that folder name as its location.

I believe my problem was on the WordPress side as the location has to be exact.

 

bellini13 was great as I initially did not think that the two applications (WordPress & Prestashop) would work together. I would have given up and created a sub-directory if if was not for bellini13 support.

 

Let me know how your setup goes and I'll try to help out. I'm not well versed in .htaccess files or writing redirects. But I'll do my best to try to help you.

 

Here's my [spam-filter]'s toy shop URL http://www.kidstoysmalaysia.com.my/

 

and her friends individual blogs sites.

 

http://www.kidstoysm...ollers-malaysia

http://www.kidstoysm...-price-malaysia

http://www.kidstoysm...-avent-malaysia

http://www.kidstoysm...cloths-malaysia

 

Let's see how well the Go Daddy webhosting holds up if the site becomes busy.

 

In any case, let me know how your installation goes and I'll check my files to see if they are similar to mine.

 

Best Regards,

 

Phil

Link to comment
Share on other sites

  • 4 years later...

Hello,

I have a similar problem: 
I use prestashop 1.6.1.X on the main root
and wordpress in the subdirectory /wp

 

I have changed the htaccess file for wordpress in the subfolder but wen I try to access to the wordpress page I'm redirect to 404 prestashop page, 
can someone help me?

This is the hatches file that I have in the main root

# ~~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
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule . - [E=HTTP_AUTHORIZATION:%1]

#Domain: test.punto-service.it
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]

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
<IfModule mod_headers.c>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$">
		Header add Access-Control-Allow-Origin "*"
	</FilesMatch>
</IfModule>

<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType text/css "access plus 1 week"
	ExpiresByType text/javascript "access plus 1 week"
	ExpiresByType application/javascript "access plus 1 week"
	ExpiresByType application/x-javascript "access plus 1 week"
	ExpiresByType image/x-icon "access plus 1 year"
	ExpiresByType image/svg+xml "access plus 1 year"
	ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
	ExpiresByType application/font-woff "access plus 1 year"
	ExpiresByType application/x-font-woff "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresByType font/opentype "access plus 1 year"
	ExpiresByType font/ttf "access plus 1 year"
	ExpiresByType font/otf "access plus 1 year"
	ExpiresByType application/x-font-ttf "access plus 1 year"
	ExpiresByType application/x-font-otf "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
	Header unset Etag
</IfModule>
FileETag none
<IfModule mod_deflate.c>
	<IfModule mod_filter.c>
		AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype
	</IfModule>
</IfModule>

#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

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Thank you!

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...