0

I have this URL:

http://www.register.abc.com/myapp/administrator/registration

Which is :

  • http://www.register.abc.com is my domain
  • myapp is my aplication folder in server
  • administrator/registration is my controller and function

What I'd like to do is to remove this part /myapp/administrator/registration from my URL. In default, when user only enter the http://www.register.abc.com/ it will be redirected to my home page. I'd like to set it so the user directly enter registration page not the home page. I have little to no knwledge about .htaccess. Any help is greatly appreciated.

Note: I am using wiredesignz codeigniter modular extensions hmvc

Edit:

my current .htaccess is like this:

<IfModule mod_rewrite.c>
    RewriteEngine on
RewriteBase /myapp
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

</IfModule>
4
  • Please share your htaccess file in your question. Also could you please let us know which url you want to hit in browser and by which url you want to rewrite/redirect in backend? That will give us better understanding of your question, thank you. Commented Feb 15, 2021 at 3:05
  • I currently have no .htaccess file. I'd like user to enter http://www.register.abc.com and they go directly to my regist page, currently it's directed to home page Commented Feb 15, 2021 at 3:29
  • I'd like to rewrite http://www.register.abc.com/myapp/administrator/registration into http://www.register.abc.com Commented Feb 15, 2021 at 3:30
  • Sure, on SO its encouraged to put efforts in form of rules/codes in questioners questions(there is nothing wrong or right in efforts), so please do add it once, thank you. Commented Feb 15, 2021 at 3:31

1 Answer 1

1

In your site root .htaccess (a level above myapp/ you may try this .htaccess code:

RewriteEngine On

RewriteRule ^$ myapp/administrator/registration [L,R=302]

If you want an internal rewrite (without changing URL) then try:

RewriteRule ^$ myapp/administrator/registration [L]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.