UnknownPlayer Posted December 15, 2010 Share Posted December 15, 2010 How can i make my address like /articles, without .php ? If i need .htaccess, then please put me all whole code that i need.. Anyway im using gets "id" and "akcija" in that php file, if needed for .htaccess.. Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/ Share on other sites More sharing options...
.josh Posted December 15, 2010 Share Posted December 15, 2010 google mod rewrite and beautifying urls. Lots of tuts out there for that. Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1147492 Share on other sites More sharing options...
UnknownPlayer Posted December 16, 2010 Author Share Posted December 16, 2010 I tried but i need someone to explain me ? :/ Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1148331 Share on other sites More sharing options...
.josh Posted December 17, 2010 Share Posted December 17, 2010 you need someone to explain to you how to google for a tutorial about beautifying urls with mod rewrite? Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1148476 Share on other sites More sharing options...
UnknownPlayer Posted December 17, 2010 Author Share Posted December 17, 2010 Someone need to explain me why it wont works to me.. Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1148568 Share on other sites More sharing options...
trq Posted December 17, 2010 Share Posted December 17, 2010 Someone need to explain me why it wont works to me.. In order to do that we would need to see your rules that don't work plus an explanation of the problem you are having. Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1148570 Share on other sites More sharing options...
UnknownPlayer Posted December 18, 2010 Author Share Posted December 18, 2010 Now it works, but css is not loaded, how can i fix that? This is the code: RewriteEngine on RewriteRule ^vest/([^/\.]+)/?$ vesti.php?id=$1 [L] And can i make when someone go to http://localhost/vesti.php?id=$id, to redirect to http://localhost/vest/$id ? Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1148846 Share on other sites More sharing options...
arbitter Posted December 19, 2010 Share Posted December 19, 2010 Hi there, I had the same problem, Google knew the answer. The css isn't loaded because its path also gets rewritten. To solve this, you have to put in a rewrite condition: RewriteCond %{REQUEST_URI} !\.(css|jpg|gif|png|js)$ [NC] though that didn't work for me. Using full path names does work though; instead of file.css use http://localhost/sitename/file.css Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1149275 Share on other sites More sharing options...
UnknownPlayer Posted December 21, 2010 Author Share Posted December 21, 2010 I tried with: RewriteCond %{REQUEST_URI} !\.(css|jpg|gif|png|js)$ [NC] But still that doesn't work.. is there some else solution ? Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1149915 Share on other sites More sharing options...
tomfmason Posted December 21, 2010 Share Posted December 21, 2010 Here is how I would do it first turn on the RewriteEngine RewriteEngine on To solve the problem with css and images don't rewrite existing files RewriteCond %{REQUEST_FILENAME} !-f Assuming your 'id' is an integer you would want to do something like this RewriteRule ^vest/([0-9]+)$ vesti.php?id=$1 [L] This should rewrite urls like /vest/123 to vesti.php?id=123 . I didn't test this but it should work without any problems Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1149943 Share on other sites More sharing options...
UnknownPlayer Posted December 22, 2010 Author Share Posted December 22, 2010 .css is still a problem, it doesn't load any image, but content is loaded.. style.css is at public folder, and images are in /images/ folder, if that can help ? :/ Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1150113 Share on other sites More sharing options...
UnknownPlayer Posted December 23, 2010 Author Share Posted December 23, 2010 What is problem there ? :S I'm on localhost, maybe that is problem ? Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1150813 Share on other sites More sharing options...
tomfmason Posted December 23, 2010 Share Posted December 23, 2010 What is problem there ? :S I'm on localhost, maybe that is problem ? Seriously? You have been given several different examples that should work with small modifications. Please don't be this guy - Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1150845 Share on other sites More sharing options...
UnknownPlayer Posted December 23, 2010 Author Share Posted December 23, 2010 What is problem there ? :S I'm on localhost, maybe that is problem ? Seriously? You have been given several different examples that should work with small modifications. Please don't be this guy - But in 2 ways images doesn't work ? Quote Link to comment https://forums.phpfreaks.com/topic/221704-articles-instead-of-articlesphp/#findComment-1150939 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.