Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8216685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:13:03+00:00 2026-06-07T12:13:03+00:00

I have an existing site built with CodeIgniter at example.com. I have a WordPress

  • 0

I have an existing site built with CodeIgniter at example.com.

I have a WordPress install at example.com/wp. Urls look like this: example.com/wp/my-page

I’m trying to figure out how I can rewrite example.com/my-page to display the contents of the example.com/wp/my-page while still displaying the URL as example.com/my-page.

CodeIgniter controls the index.php file, so I can’t use WordPress’s index.php in the root.

I’m half way there, I have it working with a plain HTML file, but getting WordPress involved rewrites the url to the /wp subdirectory.

Here’s what I’m using, in the example.com root:

<IfModule mod_rewrite.c>
RewriteEngine On
Options FollowSymLinks

RewriteBase /

RewriteRule ^my-page /wp/my-page [P]

</IfModule>

When I visit example.com/my-page I end up at example/wp.

I imagine it has something to do with the standard WordPress .htaccess in the /wp/ directory which looks like this:

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

I’ve tried adding the [P] flag to the WordPress rules but no luck, I also tried not setting the rewrite base to /wp/.

The problem is I don’t understand this stuff in enough detail to figure out my issue, or to know whether this is possible.

In summary, I think I’m trying to rewrite a rewritten URL without doing a redirect (hence the [P] flags).

Can this be done? Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:13:04+00:00Added an answer on June 7, 2026 at 12:13 pm

    $ cat .htaccess

    RewriteEngine on
    RewriteBase /
    RewriteRule ^my-page wp/my-page [L]
    

    $ tree -a wp

    wp
    |-- .htaccess
    `-- index.php
    

    $ cat wp/.htaccess

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

    $ cat wp/index.php

    <pre><?php print_r($_SERVER); ?></pre>
    

    Result:

    URL visible in browser: http://example.com/my-page
    Output:

    Array
    (
    [REDIRECT_REDIRECT_STATUS] => 200
    [REDIRECT_STATUS] => 200
    [HTTP_HOST] => example.com
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_CONNECTION] => keep-alive
    [PATH] => /usr/local/bin:/usr/bin:/bin
    [SERVER_SIGNATURE] => Apache/2.2.16 (Debian) Server at example.com Port 80
    [SERVER_SOFTWARE] => Apache/2.2.16 (Debian)
    [SERVER_NAME] => example.com
    [SERVER_ADDR] => 1.2.3.4
    [SERVER_PORT] => 80
    [REMOTE_ADDR] => 4.3.2.1
    [DOCUMENT_ROOT] => /www/vhosts/example.com/
    [SERVER_ADMIN] => webmaster@example.com
    [SCRIPT_FILENAME] => /www/vhosts/example.com/wp/index.php
    [REMOTE_PORT] => 57775
    [REDIRECT_URL] => /wp/my-page
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => 
    [REQUEST_URI] => /my-page
    [SCRIPT_NAME] => /wp/index.php
    [PHP_SELF] => /wp/index.php
    [REQUEST_TIME] => 1342091732
    )
    

    So, if you’re still seeing a redirect after this point, that is being done by wordpress php code

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site built using asp.net with ugly URLs like /DisplayContent.aspx?id=789564 .
I have an existing site that requires a background image on the home page.
I have an existing site that I'd like to convert to use routing, and
I have an existing MVC site, built some years back, and I am now
I'm trying to take an existing php file which I've built for a page
I am trying to integrate a CMS into an existing ASP.NET Web site built
I have recently started work on an existing WordPress site. The theme on the
Good Day all, I have an existing site built. I was wondering, how can
We have an existing site that we would like to convert to an Orchard
We have an existing moss publishing site. When we enable the css control adapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.