• dcairbre

    (@dcairbre)


    hi there,

    I was wondering if anybody knows of some way to disable the automatic refresh upon typing in an “ugly URL” on wordpress. E.g if I allow “pretty permalinks” in the options and then i go to a page like /?category_name=uncategorized then it automatically redirects to /category/uncategorized

    What I want to do is have the like 3 or 4 categories directly after the domain (e.g https://www.example.com/category1 etc…) I can do this fine in mod_rewrite (when ugly URL’s are enabled) but since it automatically redirects when you type in an ugly URL, apache gets all confused and throws up a 404. I’ve also tried putting in /category/category1 but that didn’t work either (presumable because /category/category1 is not an actual page) I could easily just enable ugly URL’s and it would work fine but I would still like to have my normal posts have “pretty urls”

    Here is the wordpress part of my .htaccess script

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteRule ^category1/?$ /index.php?category_name=category1 [L] (this is bit i’ve edited) I also tried putting in this (RewriteRule ^category1/?$ /category/category1 [L])
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    sorry that i’ve made this all kinda complicated :/

    thanks for anybodies help (:
    /Dara

  • The topic ‘Allowing some ugly URL's without redirect’ is closed to new replies.