Airful
Airful

Reputation: 311

WordPress and CodeIgniter htaccess

I have a site with WordPress e.g http://example.com/ and CodeIgniter in subdirectory e.g http://example.com/drinking-water-database/

The CodeIgniter URL http://example.com/drinking-water-database/developer works fine. I want to remove drinking-water-database from URL. Means http://example.com/developer will show the content of http://example.com/drinking-water-database/developer. I have write the htaccess but it's not working.

# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^developer
RewriteRule "^developer/(.*)/$" "drinking-water-database/index.php?/developer/$1" [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>
# END WordPress

I have tried every possible pattern. Even I tried only the redirect rule to make developer link working with bellow htaccess. But http://example.com/developer showing 404.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule "^developer/(.*)/$" "drinking-water-database/index.php?/developer/$1" [L,R=301]
</IfModule>

Upvotes: 1

Views: 91

Answers (1)

Saifur Rahman
Saifur Rahman

Reputation: 154

You can check with this:

Replace

RewriteRule "^developer/(.*)/$" "drinking-water-database/index.php?/developer/$1" [L,R=301]  

with

RewriteRule (.*) "drinking-water-database/index.php?/$1" [L]

Upvotes: 2

Related Questions