Support » Fixing WordPress » need expert htaccess help

  • Resolved Bloke

    (@bloke)


    I am using YOURLS Your Own URL Shortener with my WordPress setup (not as a plugin). I have followed a tutorial to get it to work in a sub directory. Everything petty much works until I click on some links on my website. It has to do with htaccess. I know its possible becuase I did it with two other wordpress sites. I copied the htaccess but didn’t work.

    My wordpress is in a subfolder /wordpress/
    My YOURLS is in /yourls/

    Below is the htaccess file in my www root.

    If I put the wordpress directions last it works if I put this
    RewriteCond %{HTTP_HOST} !^mywebsite.com$
    RewriteRule . – [S=3]

    But some links on my site won’t work.

    mywebsite.com/products/?category=2 (doesn’t work) get page not found error
    mywebsite.com/our-products/ ( works)

    # 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
    
    # BEGIN YOURLS
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^([0-9A-Za-z]+)/?$ /yourls/yourls-go.php?id=$1 [L]
    RewriteRule ^([0-9A-Za-z]+)\+/?$ /yourls/yourls-infos.php?id=$1 [L]
    RewriteRule ^([0-9A-Za-z]+)\+all/?$ /yourls/yourls-infos.php?id=$1&all=1 [L]
    </IfModule>
    # END YOURLS
Viewing 1 replies (of 1 total)
  • Thread Starter Bloke

    (@bloke)

    I got it working. I just kept comparing everything I did on my other WP sites. The permalinks were one word. So “/products/” would not work but “product-pages/” worked. Also the links were going to /products and I changed it to ?page_id=….. this let the permalink to work. Here is the instructions I used to get YOURLS to work with WP. Generating Root Short URLS From A YOURLS Subdirectory Install

Viewing 1 replies (of 1 total)
  • The topic ‘need expert htaccess help’ is closed to new replies.