Skip to main content
Formatting, grammar, spelling
Source Link
MrWhite
  • 43.1k
  • 4
  • 50
  • 90

iI am developing a phpPHP web aplicaitonapplication.i I have pages,posts posts,categoryies categories,product product and etc here.

Here is my htaccess.htaccess file to create seoSEO friendly url?URL:

when iWhen I visit
Pgae.php?Page_Id=13Page.php?Page_Id=13 it work
andworks. And also when iI visit
Page/13/Page-Title
itPage/13/Page-Title it works again.every thing Everything is good untill iwhen I test my application on the server, but it does'ntdoesn't work in wamp localhost
i.

I active

in apache http.confApache http.conf and here is my vhost:

exampleExample of error in localhost is:
 

whyWhy does it work on the server and not in localhost?

i googledI Googled a lot but it can't find anything.please save my life and my work :)

i am developing a php web aplicaiton.i have pages,posts,categoryies,product and etc here is my htaccess file to create seo friendly url?

when i visit
Pgae.php?Page_Id=13 it work
and also when i visit
Page/13/Page-Title
it works again.every thing is good untill i test my application on server but it does'nt work in wamp localhost
i active

in apache http.conf and here is my vhost

example of error in localhost is:
 

why it work on server and not in localhost?

i googled a lot but it can't find anything.please save my life and my work :)

I am developing a PHP web application. I have pages, posts, categories, product and etc.

Here is my .htaccess file to create SEO friendly URL:

When I visit Page.php?Page_Id=13 it works. And also when I visit Page/13/Page-Title it works. Everything is good when I test my application on the server, but it doesn't work in wamp localhost.

I active

in Apache http.conf and here is my vhost:

Example of error in localhost is:

Why does it work on the server and not in localhost?

I Googled a lot but it can't find anything.

Source Link

Url rewrite not work in wamp localhost

i am developing a php web aplicaiton.i have pages,posts,categoryies,product and etc here is my htaccess file to create seo friendly url?

Options -Indexes
RewriteEngine on
RewriteRule ^Page/(.*)/(.*)$ Page.php?Page_Id=$1&Page_Title=$2 [NC,L]
RewriteRule ^Product/(.*)/(.*)$ Product.php?Product_Id=$1&Product_Title=$2 [NC,L]
RewriteRule ^Category/(.*)/(.*)$ Category.php?Category_Id=$1&Category_Title=$2 [NC,L]
RewriteRule ^Single/(.*)/(.*)$ Single.php?Post_Id=$1&Post_Title=$2 [NC,L]
RewriteRule ^Blog/(.*)/(.*)$ Blog.php?Category_Id=$1&Category_Title=$2 [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
 

<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 year"
</IfModule>

when i visit
Pgae.php?Page_Id=13 it work
and also when i visit
Page/13/Page-Title
it works again.every thing is good untill i test my application on server but it does'nt work in wamp localhost
i active

LoadModule rewrite_module modules/mod_rewrite.so

in apache http.conf and here is my vhost

    <VirtualHost *:8080>
    ServerName localhost
    DocumentRoot c:/wamp64/www
    <Directory  "c:/wamp64/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>


<VirtualHost *:8080>
    ServerName schoolarshop
    DocumentRoot "c:/wamp64/www/schoolarshop"
    <Directory  "c:/wamp64/www/schoolarshop/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride none
        Require local
    </Directory>
</VirtualHost>

example of error in localhost is:

Notice: Undefined index: Page_Id in Page.php on line 8

why it work on server and not in localhost?

i googled a lot but it can't find anything.please save my life and my work :)