How to make friendly URL open in root.
I have the file WorkView.php? id = 1 would like it to open like this:
www.site.com/87190-first-test
Does not work:
RewriteRule ^([^/]*)\$ /trabalhoVer.php?id=$1 [NC,L]
How to make friendly URL open in root.
I have the file WorkView.php? id = 1 would like it to open like this:
www.site.com/87190-first-test
Does not work:
RewriteRule ^([^/]*)\$ /trabalhoVer.php?id=$1 [NC,L]
Try this way, please see if it is resolved:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ trabalhoVer.php?id=$1 [QSA,L]
</IfModule>
As requested in the comment, I tested on port 8080 like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{SERVER_PORT} !^8080$
RewriteRule ^(.*) http://%{SERVER_NAME}:8080%{REQUEST_URI}
RewriteCond %{SERVER_PORT} ^8080$
RewriteRule ^(.*)$ trabalhoVer.php?id=$1 [QSA,L]
</IfModule>
Here it worked. See: