Forum Moderators: phranque
http://example.com/index.php?page=about
http://example.com/about
index.php?page=to
http://example.com/$GETvariable name.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1
<li><a href="index.php?page=about">About</a></li>
http://example.com/index.php?page=about
http://example.com/about
[edited by: phranque at 2:24 pm (utc) on Jul 23, 2013]
[edit reason] Please Use Example.com [webmasterworld.com] [/edit]
[edited by: phranque at 11:31 pm (utc) on Jul 30, 2013]
[edit reason] unlinked url [/edit]
Only when I enter http:/ /localhost/%1? it shows that kind of error(404 error)
With anything other it says it that connection to the server failed and shows.
localhost:1337/(example variable)
RewriteCond %{THE_REQUEST} \?
RewriteCond %{QUERY_STRING} page=([a-z]+)
RewriteRule ^index\.php$ /%1? [R=301,L]
RewriteRule ^([a-z]+)$ /index.php?page=$1 [L]
ServerName localhost:1337
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride All
Require all denied
</Directory>
Would it be harm to erase localhost:1337 and put just loclahost in Apache config file?
localhost/test_folder_name/.Without http:// www.example.com/news.php?id=1 to
example.com/news/title-of-news
I would like to put banner of your website to my website.
So I'm wondering how is possible to do this kind of thing.
example.com/n1-title-of-news where n1 means news item number one
example.com/cats/some-cat
example.com/some-cat
$abc=$row['example_text'];
Then I've made a variable:
$href=str_replace(" ","-","$abc");
echo "<a href=".$href.">Link</a>";
RewriteEngine on
RewriteCond %{THE_REQUEST} [A-Za-z0-9]\ /Example-Text\ HTTP/
RewriteRule ^Example-Text$ /text.php [L]
example.com/cats/some-cat
RewriteRule ^paintings/(spare[cr]ats|misc|pending)/(\w+)\.html /paintings/misc/misclinks.php?subdir=$1&page=$2 [L,NS]
Like convert
somepage/example-page--->somepage.php?text=example-page
So is second example a good solution or not?
somesite.com/cat-food to be index.php?title=dog-food
somesite.com/dog-food to be index.php?title=dog-food
$href=str_replace(" ","-",$row['title']);
echo "<a href=category/".$href." >".$row['title']."</a><br/>";
So it showed like desired results like
category/some-name
www.example.com/category/newpage www.example.com/index.php?title=newpage mystyles.css www.example.com/category/mystyles.css