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 help needed

Featured Replies

Hello, currently trying to modify the URL so that instead of www.website.co.uk/?page=about

i can use www.website.co.uk/about

 

the following works, i can type www.website.co.uk/about it takes me to the correct page etc but the URL changes to www.website.co.uk/?page=about but i want to stay like www.website.co.uk/about

 

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.website\.co.uk)?$
RewriteRule ^(.*)$ http://www.website.co.uk/$1 [R=301,L]

RewriteRule ^([a-z]+)$ http://www.website.co.uk/?page=$1 [NC]
RewriteRule ^blog/([0-9]+)$ http://www.website.co.uk/?page=blog&article=$1 [NC]

 

Any help would be great

  • Author

Change

 

RewriteRule ^(.*)$ http://www.website.co.uk/$1 [R=301,L]

to

 

RewriteRule ^(.*)$ index.php?page=$1 [R=301,L]

 

Thanks, that sorted that problem, only problem now is that it doesnt let me put just the url like www.example.co.uk,

 

It puts www.example.co.uk/var/www/vhosts/ and so on

 

Ive tried a few things but cant manage to get it working

Oops it should have been change

 

RewriteRule ^([a-z]+)$ http://www.website.co.uk/?page=$1 [NC]

to

 

RewriteRule ^([a-z]+)$ index.php?page=$1 [NC]

  • Author

Oops it should have been change

 

RewriteRule ^([a-z]+)$ http://www.website.co.uk/?page=$1 [NC]

to

 

RewriteRule ^([a-z]+)$ index.php?page=$1 [NC]

 

Thats it haha, Now when i go to blog without the article variable set it makes the url go like

 

http://www.website.co.uk/blog/?page=blog

instead of just /blog/

I can do it so that will work, but then /blog/10 wont when i actually want to go to an individual article

Try:

 

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.website\.co.uk)?$
RewriteRule ^(.*)$ http://www.website.co.uk/$1 [R=301,L]

RewriteRule ^blog/?([0-9]*)$ index.php?page=blog&article=$1 [NC,L]
RewriteRule ^([a-z]+)$ index.php?page=$1 [NC]

  • Author

Try:

 

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.website\.co.uk)?$
RewriteRule ^(.*)$ http://www.website.co.uk/$1 [R=301,L]

RewriteRule ^blog/?([0-9]*)$ index.php?page=blog&article=$1 [NC,L]
RewriteRule ^([a-z]+)$ index.php?page=$1 [NC]

 

Hey, Thanks works a charm :) +1 to both of yous

 

Just one thing though,

 

When i go to www.website.co.uk/blog via a link it puts http://www.website.co.uk/blog/?page=blog&article=

But if i type it direct into the address bar it says as just /blog

Any ideas why that is?

 

Gary

Probably because your links are:

 

<a href="etc.com/blog/?page=blog&article=123">

 

When they should be:

 

<a href="etc.com/blog/123">

 

???

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.