php - mod_rewrite issue in code igniter -


setting

'rewritebase /' 

on production site and

'rewritebase /mysitefolder' 

on development site solved this, hope helps guy.


i have big issue modrewrite , codeigniter, , have these rewrite rules:

### go godpanel  rewriterule ^/godpanel$ /panel/godpanel [l] 

i can't make rule rewrite page in way:

myhosting.com/godpanel

to

myhosting.com/panel/godpanel

it keeps saying pages doesn't exist. can't make other rules work properly, rule works original rewrites index.php

# if default controller other # "welcome" should change rewriterule ^(start(/index)?|index(\.php)?)/?$ / [l,r=301] rewriterule ^(.*)/index/?$ $1 [l,r=301] 

hope can understand me. thanks!

(edited)

well changed since yesterday, when point localhost/mysite.com/mycontroller works, when poin localhost/mysite.com/godpanel url changes localhost/panel/godpanel

seems rules apllying in wrong way

im noob regexp in mod rewrite files :(

heres entire file

#rewriteengine on #rewritecond $1 !^(index\.php|public|robots\.txt) #rewritecond %{request_filename} !-f #rewritecond %{request_filename} !-d #rewriterule ^(.*)$ index.php/$1 [l,qsa]  <ifmodule mod_rewrite.c>      rewriteengine on      ### go godpanel      rewriterule ^godpanel$ /weird/stuff [r=301,l]      ### canonicalize codeigniter urls      # if default controller other     # "welcome" should change     rewriterule ^(start(/index)?|index(\.php)?)/?$ / [l,r=301]     rewriterule ^(.*)/index/?$ $1 [l,r=301]      # removes trailing slashes (prevents seo duplicate content issues)     rewritecond %{request_filename} !-d     rewriterule ^(.+)/$ $1 [l,r=301]      ###      # checks see if user attempting access valid file,     # such image or css document, if isn't true sends     # request index.php     rewritecond %{request_filename} !-f     rewritecond %{request_filename} !-d     rewriterule ^(.*)$ index.php/$1 [l]  </ifmodule>  <ifmodule !mod_rewrite.c>      # without mod_rewrite, route 404's front controller     errordocument 404 /index.php  </ifmodule> 

make sure godpanel rule above other rules.

secondly try removing forward slash start of ^/godpanel part of rule:

rewriterule ^godpanel$ /panel/godpanel [r=301,l] 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -