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 8628567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:34:49+00:00 2026-06-12T08:34:49+00:00

Lets say that I want to show http://example.com/topic/view/topicname/thenameofthetopic direclty as http://example.com/thenameofthetopic So I have

  • 0

Lets say that I want to show http://example.com/topic/view/topicname/thenameofthetopic direclty as http://example.com/thenameofthetopic

So I have achieved that when entering http:// example.com/thenameofthetopic , it redirects you to the controller/action properly, and the website shows what I want to show, the problem is that of course, the URL changed, and I want it to maintain the format http://example.com/thenameofthetopic

Is that possible whitout touching the htaccess file? Just configuring it with yii

How should I do that?

  • 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-12T08:34:50+00:00Added an answer on June 12, 2026 at 8:34 am

    Exactly your case is:

    'components'        => array(
      'urlManager' => array(
          'urlFormat'      => 'path',
          'showScriptName' => false,
          'rules' => array(
              "<name_of_topic:\w+>/" => 'controller/action'
           ),
       ),
    )
    

    You will get the name of topic in Yii::app()->request->getQuery(‘name_of_topic’);

    htaccess is Yii – classic, the must be present:

    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L,QSA]
    

    I would advice you to do another way.

    'components'        => array(
      'urlManager' => array(
          'urlFormat'      => 'path',
          'showScriptName' => false,
          'rules' => array(
              "t/<name_of_topic:\w+>/" => 'controller/action'
           ),
       ),
    )
    

    So topic link will be http://www.example.com/t/name_of_topic.
    This will allow you to use “a//” for articles etc.

    One more thing. Read this article to find much interesting things http://www.yiiframework.com/doc/guide/1.1/en/topics.url

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

Sidebar

Related Questions

Let's say that I have an application frame, and I want to show a
Lets say that I have an executable and when it is started I want
Let's say this page www.example.com/mypage returns some html that I want to parse in
For Actionscript 2.0 Let's say this page www.example.com/mypage returns some html that I want
Let's say I have 3 models (Note, Comment, Article) that I want to search
Lets say we have a Company model, that has many Employees And has many
I want to make buttons similar to those on this website. Lets say that
Let's say I've published a few WordPress posts with the following URLs: http://example.com/2011/08/show_this/ http://example.com/2011/08/hide_this/
Let's say I have a nested resource like in the Rails guide example: http://guides.rubyonrails.org/routing.html#nested-resources
Lets say I have two objects, and I want to use action script to

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.