• I’ve created several content management systems, each of which uses an .htaccess file that looks something like this…

    # POLITIX
    # You don’t need to restart anything after modifying .htaccess.
    # http://www.sitepoint.com/forums/showthread.php?t=290965
    # http://www.sitepoint.com/forums/showthread.php?t=290638
    # Add /? before first $ in every row if you want optional trailing slashes.
    RewriteEngine On
    RewriteRule ^test\.htm$ test.php [L]
    Options -MultiViews

    # php_value magic_quotes_gpc 0
    php_flag magic_quotes_gpc Off

    # ó ¡ í á (accented a)

    # RewriteRule ^/([a-zA-Z0-9()_/-]+)/?$ index.php?home=$1 [L]
    RewriteRule ^About/([a-zA-Z0-9()_/-]+)/?$ About/index.php?bout=$1 [L]
    RewriteRule ^World/([a-zA-Z0-9()_/-]+)/?$ World/index.php?area=$1 [L]
    RewriteRule ^People/([a-zA-Z0-9()_/-]+)/?$ People/index.php?ppl=$1 [L]
    RewriteRule ^Orgs/([a-zA-Z0-9()_/-]+)/?$ Orgs/index.php?org=$1 [L]
    RewriteRule ^Topics/([a-zA-Z0-9()_/-]+)/?$ Topics/index.php?topic=$1 [L]
    RewriteRule ^Essays/([a-zA-Z0-9()_/-]+)/?$ Essays/index.php?ess=$1 [L]
    RewriteRule ^Exposes/([a-zA-Z0-9()_/-]+)/?$ Exposes/index.php?exp=$1 [L]
    RewriteRule ^Revolt/([a-zA-Z0-9()_/-]+)/?$ Revolt/index.php?rev=$1 [L]
    RewriteRule ^Reference/Glossary/([a-zA-Z0-9$()_/-]+)/?$ Reference/Glossary/index.php?glos=$1 [L]
    RewriteRule ^Reference/([a-zA-Z0-9()_/-]+)/?$ Reference/index.php?ref=$1 [L]
    RewriteRule ^Search/([a-zA-Z0-9()_/-]+)/?$ Search/index.php?see=$1 [L]
    # RewriteRule ^/?([-a-zA-Z0-9_/]+)/?$ /index.php?home=$1 [L]

    * * * * *
    In particular, almost all of my sites have World and Topics sections, with the first letters capitalized (e.g. MySite/World, MySite/Topics).

    I just created my first WordPress site and uploaded an .htaccess file with the following code:

    # GREAT DEPRESSION
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    I’d like to know if it’s possible to either somehow combine both sets of mod-rewrite rules or find some sort of workaround. Let me explain what I’m trying to do.

    Though I’m initially impressed with WordPerfect, it is taking me some time to figure out how to modify pages with themes, templates, etc. In addition, I was disappointed to learn that WordPress doesn’t allow capital letters in URL’s. I want to incorporate WordPress into several major websites, all of which do use capital letters in URL’s (e.g. http://www.geozoo.org/World/Spain). Changing literally thousands of URL’s could wreck my search engine rankings.

    So here’s my scheme. Instead of using WordPress to post articles in the World and Topics sections, I’ll post everything in a general Blog or News section (MySite/News) and invite feedback and discussion. For example, I might make three or four posts focusing on Venezuela.

    After I’ve gathered sufficient information, I can then combine the material from those posts into a single article about Venezuela and publish it to MySite/World/Venezuela – without using WordPress. I’d just insert the article in a database table and publish it online. The original articles would remain online, in WordPress format.

    There may be a very simple workaround…

    I installed WordPress in my main directory, so it more or less took over my entire site, then created several categories that modify links to point to MySite/world or MySite/topics.

    What if I uninstalled WordPress, then reinstalled it in the directory MySite/news? Any post published at MySite/news/post would obviously be a WordPress page, subject to WordPress rules, .htaccess file, etc. But would pages in other sections – e.g. MySite/World – be free of WordPress restrictions?

    To put it another way, could I publish my original .htaccess file to my website’s root, then publish a WordPress-only .htaccess file to MySite/news?

    I hope my questions aren’t too confusing. I’m just a beginner, and I’m sort of thinking out loud. But I’d like to try and figure out some sort of scheme before I get in too deep. I have several major websites to convert.

    Thanks!

The topic ‘Mixing Mod-Rewrite Rules’ is closed to new replies.