-4

I want for example make this:

Original URL: domain.com/folder/index.php?i=something

Changed URL: domain.com/folder/something

But keeping the content of the original URL, with the RewriteRule of apache. And can someone tell me of a good tutorial or a documentation of how to use that?

  • 1
    You should go see this post: http://stackoverflow.com/questions/1039725/how-to-url-re-writing-in-php – freddy Jan 14 '14 at 02:39

2 Answers2

0

Open httph.conf fine : #LoadModule rewrite_module modules/mod_rewrite.so, then uncheck # (LoadModule rewrite_module modules/mod_rewrite.so) Create .htaccess file

RewriteEngine on
RewriteRule ^folder/([a-zA-Z0-9_-]+)/([0-9]+).html$ index.php?id=$2

RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{REQUEST_URI} !^/folder/
RewriteRule (.*) /folder/$1

you config error ErrorDocument Error_code /error.html Example: ErrorDocument 404/error_404.html

phuc.nx
  • 78
  • 3
-1
# Open The RewriteEngine 
RewriteEngine On

RewriteBase /

# Rewrite 

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^bbs/test-([0-9]+)\.html$ bbs/test.php?id=$1&%1

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^jingdian-([0-9]+)\.html$ jingdian.php?id=$1&%1
freddy
  • 159
  • 1
  • 4
  • 23