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

  • SEARCH
  • Home
  • 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 8474317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:35:37+00:00 2026-06-10T17:35:37+00:00

Here’s my setup: config.php ‘urlManager’=>array( ‘urlFormat’=>’path’, ‘rules’=>array( ‘<controller:\w+>/<id:\d+>’=>'<controller>/view’, ‘<controller:\w+>/<action:\w+>/<id:\d+>’=>'<controller>/<action>’, ‘<controller:\w+>/<action:\w+>’=>'<controller>/<action>’ ), ‘showScriptName’=>false, ), .htaccess

  • 0

Here’s my setup:

config.php

 'urlManager'=>array(
          'urlFormat'=>'path',
          'rules'=>array(
           '<controller:\w+>/<id:\d+>'=>'<controller>/view',
           '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
           '<controller:\w+>/<action:\w+>'=>'<controller>/<action>'
          ),
          'showScriptName'=>false,
 ),

.htaccess:

Options +FollowSymlinks
#+FollowSymLinks must be enabled for any rules to work, this is a security
#requirement of the rewrite engine. Normally it's enabled in the root and we
#shouldn't have to add it, but it doesn't hurt to do so.

RewriteEngine on
#Apache scans all incoming URL requests, checks for matches in our
#.htaccess file 
#and rewrites those matching URLs to whatever we specify.

#allow blank referrers.
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?site.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?site.dev [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?dev.site.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


# otherwise forward it to index.php
RewriteRule . index.php

On layout menus I have this:

$this->widget('zii.widgets.CMenu', 
    array('items'=>
        array(
            array(
                'label'=>Yii::t('site','A'),
                'url'=>array('/site/index')
            ),
            array(
                'label'=>Yii::t('site','Q'),
                'url'=>array('rooms/index')
            ),
            array(
                'label'=>Yii::t('site','G'),
                'url'=>array('gastronomy/index')
            ),
            array(
                'label'=>Yii::t('site','A'),
                'url'=>array('activity/index')
            ),
            array(
                'label'=>Yii::t('site','S'),
                'url'=>array('services/index')
            ),
            array(
                'label'=>Yii::t('site','C'),
                'url'=>array('contacts/index')
            ),
            array(
                'label'=>Yii::t('site','R'),
                'url'=>array('booking/index')
            )
        )
    )
);

I explicit call index here, because it seems that, calling it explicitly is required.

With this setup, each time I click on those links I get, for example:

http://site.dev/rooms/index

While I wish to get:

http://site.dev/rooms/

W/out the index name.

What am I missing here ?

  • 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-10T17:35:38+00:00Added an answer on June 10, 2026 at 5:35 pm

    There is difference between index entry file and default action. You’re messing those things.
    If you make 'showScriptName'=>true you will see, that your links will be changed to something like /index.php/rooms/index where index.php is the index entry file.

    As you see with option 'showScriptName'=>false you don’t have that index.php in your links, that means that you successfully removed entry script from links.

    Now your room/index is controller/action part of URL route. room is controller and index is action.
    To see http://site.dev/rooms/ instead of http://site.dev/rooms/index you have to edit your URL routes like that:

    'urlManager'=>array(
        'urlFormat'=>'path',
        'rules'=>array(
            '<controller:\w+>/<id:\d+>'=>'<controller>/view',
            '<controller:\w+>'=>'<controller>/index',
            '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
            '<controller:\w+>/<action:\w+>'=>'<controller>/<action>'
        ),
        'showScriptName'=>false,
    ),
    

    Notice the line '<controller:\w+>'=>'<controller>/index' i added. That makes default action index to create controller route instead of controller/index.

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

Sidebar

Related Questions

Here is my problem : I have a post controller with the action create.
here is my php code $titikPetaInti = array(); while($row = mysql_fetch_assoc($hasil2)) { $titikPetaInti[] =
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here is what I am currently doing. PHP echo's out the recent post in
Here's the basic setup: I have a thin bar at the top of a
here's my code public String path; public String fileName; public static void readData() throws
Here is what I am trying to achieve in PHP: I have this string:
Here's the code require_once 'functions.php'; require_once 'cfg.php'; $mysqli = new mysqli($dbhost, $dbuser, $dbpass, $db);
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works

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.