Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Clean URL Alternative

Featured Replies

If you have set up mod rewrite in Apache or the IIS equivalent, you know it can be a pain.

I think I may have found an alternative.

 

The url looks like this:

http://domain.com/?/this/is/a/clean/url

Where 'this/is/a/clean/url' is the actual page path.

 

The ? makes the server not look up 'folder path' and it also doesn't read it the page path as a url variable. I plan on using it as a backup for users who don't run clean urls with my CMS.

 

Both ASP.net and PHP are able to retrieve that 'clean url' segment in the url request on the server side. I then strip off the page path and use it.

For example in c# I do the following:

 

String url_path = "";
String[] url_array = { };
if (Request.Url.ToString().Replace("?", "") != Request.Url.ToString())
    {
         url_path = Request.Url.ToString().Replace("?/", "╚").Split('╚')[1];
         url_array = url_path.Split('/');
    }

Does this make sense?

  • Author

Does this make sense?

  • Author

Rewriting URLs is very easy and am pretty sure all but the rubbish hosts don't support this option.

 

Your method seems quite manual though and seems a really messy way of doing things. Most CMS's have the option to use normal (E.g. page.php?page=234234) urls instead of rewrtten ones.

 

 

The idea here is to replace that default url (E.g. page.php?page=234234) with the 'clean url alternative'.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.