November 27, 201213 yr 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
November 27, 201213 yr Change RewriteRule ^(.*)$ http://www.website.co.uk/$1 [R=301,L] to RewriteRule ^(.*)$ index.php?page=$1 [R=301,L]
November 30, 201213 yr 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
December 1, 201213 yr 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]
December 1, 201213 yr 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
December 1, 201213 yr 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]
December 7, 201213 yr 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
December 8, 201213 yr 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