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.

.htaccess again.

Featured Replies

Riiight, I made a post about this like year/year half ago, cant find it so ill make another,

 

Want some SEO friendly urls

 

this is what I got so far..

RewriteRule ^page/about$ http://www.irn3rd.co.uk/index.php?page=about [L]

 

this lets me put in http://www.irn3rd.co.uk/page/about and it directs me to the page, but in the url it doesn't stay as that and goes to the ugly style url. How do I make this work dynamically?

 

Many thanks Ben

Hi Ben, try this:

 

RewriteEngine On
RewriteRule ^(.*)/(.*)$ ./index.php?$1=$2 [NC]

 

Dave

  • Author

Hi Ben, try this:

 

RewriteEngine On
RewriteRule ^(.*)/(.*)$ ./index.php?$1=$2 [NC]

 

Dave

Superb that worked... but... My link Never happened last time :S

 

Any idea what may have caused this?

 

 

And its not leting me view my sub directories now.

Superb that worked... but... My link Never happened last time :S

 

Any idea what may have caused this?

 

 

And its not leting me view my sub directories now.

 

I'm not sure why yours wasn't working, never tried anything hard written like that.

 

I'll explain how the example I did for you works if that helps.

 

 

 


RewriteRule ^(.*)/(.*)$ ./index.php?$1=$2 [NC]

# ^ asserts position at start of string
# $ asserts position at end of search string
# ( ) - Everything inside is captured to a back refernce, in order. 
# ie. First ( ) = $1, Second ( ) = $2 and so on..
# .* matches any char (except newline) 0 or more times

# ./ means current directory (Saves you hardcoding full URL & avoid other issues)
# $1 & $2 spit out captures
# [NC] No case/Case insensative matching

 

 

Dave

  • Author

thanks for the explanation, makes it easier to understand. your example worked, but when the site loaded, no images were displayed and any subdirectory i tried going to wouldn't work and kept redirecting me to the homepage.

 

I'll keep having a play around with it.

thanks for the explanation, makes it easier to understand. your example worked, but when the site loaded, no images were displayed and any subdirectory i tried going to wouldn't work and kept redirecting me to the homepage.

 

I'll keep having a play around with it.

 

 

Ah.. this should fix it

 


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ ./index.php?$1=$2 [NC]

#RewriteCond %{REQUEST_FILENAME} !-d
#Doesn't serve index.php for a real directory
#RewriteCond %{REQUEST_FILENAME} !-f
#Doesn't serve index.php for a file that already exists on server 

I've noticed images still not working on your site, this will finally fix it!

 

Add a / infront of your image src

 

/img/twitter.gif

 

It works, I just tried it with firebug.

  • Author

I've noticed images still not working on your site, this will finally fix it!

 

Add a / infront of your image src

 

/img/twitter.gif

 

It works, I just tried it with firebug.

PERFECT, Owe you one mate :)

 

Should realised that from my portfolio page really... oh well ive learnt something, cheers buddy :)

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.