ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

URL Problem

February 05, 2009 10:16pm

Subscribe [2]
  • #1 / Feb 05, 2009 10:16pm

    Karlo Ian

    59 posts

    Hi there… i have trouble in the URL..

    this is the default URL that this display

    <a href="http://localhost/cnchs/index.php/site/archives/">http://localhost/cnchs/index.php/site/archives/</a>

    can i change this into

    <a href="http://localhost/cnchs/archives/">http://localhost/cnchs/archives/</a>

    ?

    can i remove the index.php and the template group and i will be directing to the template name?

    thanks..

  • #2 / Feb 05, 2009 11:44pm

    MeanStudios

    335 posts

    You would have to use a .htaccess rewrite rule for that, but I’m not savvy enough in regex to write an effective one up 😕.

    Update:
    Taking a stab at the htaccess file

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^localhost$
    RewriteCond $1 !^(index\.php|images|css|robots\.txt)
    RewriteRule ^cnchs/(.+)/$ /cnchs/index.php/site/$1 [L]

    I haven’t tested this, but what it should do is this:
    http://localhost/cnchs/archives/ <—points to http://localhost/chnchs/index.php/site/archives/
    http://localhost/cnchs/homepage/ <—points to http://localhost/chnchs/index.php/site/homepage/
    etc…

    In the second line, you need to add any physical folders or files under cnchs.  You only need to list the top level folders or the files directly in the cnchs directory, don’t list any subfolders or files in subfolders as it’s not needed.

    I’m not sure if this will work, let me know what’s wrong if it doesn’t so I can help you fix it.

  • #3 / Feb 06, 2009 12:25am

    Karlo Ian

    59 posts

    same thing that also runs in my mind. but i’m not familiar using .htaccess i thought that there will be other options. thanks.. for the reply..

  • #4 / Feb 06, 2009 12:34am

    MeanStudios

    335 posts

    I updated my original post, just posting here so you’ll get an email saying the thread is updated.

  • #5 / Feb 06, 2009 1:06am

    Karlo Ian

    59 posts

    thank you very much..

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases