0

My web application url is something like http://www.example.com

Now i want that the end user will always see http://www.example.com in there

browser inseted of something like http://www.example.com/index or any thing after the / will not show to the end user

i.e http://www.example.com/abc.php?id='someid'

will display in the user browser as http://www.example.com

Thank You in advance and sorry for the bad english.....

Gulim Shah
  • 194
  • 7
  • Is it possible to do so? URL need to remain same irrespective which ever page you are accessing (index.php, login.php). Ajax, Rewrite URL ?? Waiting for answers :) – Makesh Jul 02 '15 at 06:12
  • in 90ies frameset do this behavier but it was never a good handling – donald123 Jul 02 '15 at 06:14
  • if you are familiar with webmin which is gui web interface for centos administration, the webmin is also use the same technique the url in the browser is remain static but the method ,function are changing ...... – Gulim Shah Jul 02 '15 at 08:16

1 Answers1

0

There are several ways to do that. REST web service, URL shortening, changing the alias or creating an .htacces file.

An easy way to do that would be creating an .htaccess file in your root directory.

If you’re running Apache, you can do that by creating a redirect in your site’s .htaccess file. If you don’t already have one, just create a new file called “.htaccess” in your site’s web root.

Save this inside your .htaccess file:

<IfModule mod_rewrite.c>
   RewriteEngine On

   # Send would-be 404 requests to Craft

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>

That rewrite rule basically says, “If a request is coming in that doesn’t map to an existing folder or file, pass it along to index.php instead.”

source http://buildwithcraft.com/help/remove-index.php

and check this htaccess remove index.php from url

Community
  • 1
  • 1
monirz
  • 534
  • 5
  • 14