• Resolved JNashHawkins

    (@jnashhawkins)


    Been fighting this one since Friday. Figured it’s time to ask for help.

    I’m running a WP install in the root directory in order to make use of the multisite capabilities and have domain mapping running.

    I’m also running Pligg in a sub-directory but a rewrite forces Pligg to be the actual site frontend (I’m going somewhere with this idea down the road further).

    The site runs fine, I’m running Pretty Permalinks on the WordPress, but now I’ve run into a few problems with categories in WP. As far as I can tell everything else works.

    This is the category link from within a post https://wildwellent.com/blog/index.php/store/
    ! Doesn’t work!

    This does work https://wildwellent.com/index.php?category_name=store.

    Here’s the whole htaccess file from root!

    # Needed before any rewriting
    
    RewriteEngine On
    
    ### Built using the .htaccess 301 Redirect Generator from Web Site Advantage
    ### https://seo-website-designer.com/HtAccess-301-Redirect-Generator
    ### Place after 'RewriteEngine On' and before any CMS specific rewrite rules
    
    ## 301 Redirects
    # 301 Redirect 1
    
    RewriteCond %{QUERY_STRING} ^p=([0-9]*)$
    
    RewriteRule ^$ index.php/$1 [L]
    
    RewriteRule ^$ /pligg/ [R=301,NE,NC,L]
    
    RewriteRule ^index\.html$ /pligg/ [R=301,NE,NC,L]
    
    RewriteCond %{QUERY_STRING} ^p=([0-9]*)$
    
    RewriteRule ^$ index.php/$1 [L]
    
    RewriteRule /pligg/sitemapindex.xml /pligg/module.php?module=xml_sitemaps_show_sitemap [L]
    
    RewriteRule /pligg/sitemap-([0-9a-z]+).xml /pligg/module.php?module=xml_sitemaps_show_sitemap&i=$1 [L]
    
    ### Built using the .htaccess 301 Redirect Generator from Web Site Advantage
    ### https://seo-website-designer.com/HtAccess-301-Redirect-Generator
    ### Place after 'RewriteEngine On' and before any CMS specific rewrite rules
    
    # BEGIN WordPress
    
    RewriteBase /
    
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress

    Any ideas??

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I’m also running Pligg in a sub-directory but a rewrite forces Pligg to be the actual site frontend (I’m going somewhere with this idea down the road further).

    Why?

    Why not install WP in a subfolder?

    Thread Starter JNashHawkins

    (@jnashhawkins)

    I want to run multisite with domain mapping! The root seems to be the best if not the only way.

    In the near future we plan to run Pligg in the sub directories for each site as needed.

    All of this works fine except the categories. I didn’t realize the categories were broken until now and I’m stymied on the rewrite for the categories.

    This setup has been working fine for several months except possibly the category issue.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The root seems to be the best if not the only way.

    You could also install it in a subdomain. So WP is at wordpress.domain.com and then map things as needed.

    https://wildwellent.com/blog/index.php/store/ redirects right now (which is a workaround, I guess…)

    That you have index.php in there at all is weird though. Why is that in there?

    Thread Starter JNashHawkins

    (@jnashhawkins)

    All the documentation I read says multisite WordPress with the domain mapping plugin requires WordPress to be in the root directory. So I installed WordPress first then put Pligg in the subdirectory.

    Since we wanted Pligg to run as the Front End to the site, htaccess redirects any request for root to the Pligg subdirectory but if the request is for index.php htaccess loads WordPress instead. This was done this way because I couldn’t think of any other way to make this work except maybe a work around in WordPress’ own code or the built in WP rewrite engine.

    Right now I only have 5 categories so I’m doing brute force redirects with this in htaccess.

    ## 301 Category Redirects
    # 301 Redirect 1
    RewriteCond %{HTTP_HOST}  ^wildwellent\.com$ [NC]
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^blog/index\.php/store/$ https://wildwellent.com/index.php?category_name=store [R=301,NE,NC,L]
    
    RewriteCond %{HTTP_HOST}  ^wildwellent\.com$ [NC]
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^blog/index\.php/store/games-store/$ https://wildwellent.com/index.php?category_name=store/games-store [R=301,NE,NC,L]
    
    RewriteCond %{HTTP_HOST}  ^wildwellent\.com$ [NC]
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^blog/index\.php/uncategorized/$ https://wildwellent.com/index.php?category_name=uncategorized [R=301,NE,NC,L]
    
    RewriteCond %{HTTP_HOST}  ^wildwellent\.com$ [NC]
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^blog/index\.php/news/$ https://wildwellent.com/index.php?category_name=news [R=301,NE,NC,L]
    
    RewriteCond %{HTTP_HOST}  ^wildwellent\.com$ [NC]
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^blog/index\.php/store/transport/$ https://wildwellent.com/index.php?category_name=store/transport [R=301,NE,NC,L]
    
    ## End 301 Category Redirects
    # 301 Redirect 1

    But I need little bit of logic around that to handle additional categories without adding more htaccess rules. I’m getting there but wonder if there’s a fix or a better way.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    When you make a post here, please use the CODE button (see the buttons above the text field?) and not the b-quote one for your code ?? Makes it more readable.

    All the documentation I read says multisite WordPress with the domain mapping plugin requires WordPress to be in the root directory. So I installed WordPress first then put Pligg in the subdirectory.

    Yes, but root can also be wordpress.domain.com ?? A subdomain can ‘act’ as root you see. If all you’re doing is mapped domains, that would be safer and easier.

    Thread Starter JNashHawkins

    (@jnashhawkins)

    Yeah, but I want everything in the one domain. Not a sub-domain since future plans will incorporate other changes and incorporation of Pligg features into WordPress.

    What I want is WordPress’ best features taking over Pligg’s less capable abilities.

    So anyway, I have it working for now and will re visit this issue further down the road. Maybe then I’ll have figured out the better way.

    Thanks for your input.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Htaccess Rewrite and Categories problem’ is closed to new replies.