url-rewriting

url rewriting an id with a string variable

£可爱£侵袭症+ 提交于 2019-12-06 21:59:46
trying to figure out how to rewrite this url clientside blog.com/post/how-to-get-the-ladies to point serverside to blog.com/post.php?id=123 i know how to do this: blog.com/post/123 RewriteRule ^([^/]+)/?$ post.php?id=$1 [NC,L] but how do you replace the id string with the post title slug? The webserver itself doesn't make this distinction and cannot translate from your "unique text identifier" to the database id. Therefore a .htaccess rule alone evaluated by the webserver will not help you. But how is it done on all those web-applications? Normally this translation is done by Joomla/Wordpress

SEO URL based on category name without have a category id in URL

末鹿安然 提交于 2019-12-06 21:56:28
I have two table posts & categories post_id | post_title | post_content | post_cat -------------------------------------------------- 1 Hello World welcome to my.. 1 . .. .. .. categories table cat_id | cat_name | cat_parent ----------------------------- 1 News NULL 2 Sports 1 . ... .. Let's say current category link for news is http://domain.com/category/1/ MySQL statment SELECT posts.post_id, posts.post_id, posts.post_title, posts.post_content, posts.post_cat, categories.cat_id, categories.cat_name, categories.cat_parent FROM posts INNER JOIN categories ON posts.post_cat = categories.cat_id

Delete get variables and .php using htaccess

吃可爱长大的小学妹 提交于 2019-12-06 21:53:26
I'm trying to solve some htaccess question and I'm not able to reach the solution. I have the following html: <a href="www.site.com/home.php?Idi="English">English</a> <a href="www.site.com/home.php?Idi="Française">Française</a> and the goal is that user just gets in its address bar: www.site.com/home/English or www.site.com/home/Française Obviously, the get variables should arrive to home.php to be processed. Also, the site has other pages with extension .php and I got delete each extension with: Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME}.php -f

href tags in jsp's and passing data by clicking on href tag

和自甴很熟 提交于 2019-12-06 21:03:32
this is my program <form method="post"> Movie Name :<input type="text" name="movie"/><br> Hero:<input type="text" name="hero"><br> Director:<input type="text" name="dir"><br> <a href="insert.jsp">Insert</a> <a href="update.jsp">update</a> <a href="delete.jsp">Delete</a> when i click on the any of the href link the values of above text boxes should also to be carried to that particular jsp page i used getparameter method but i am not getting what i entered but they are taking null values This is because your href elements are simply redirecting to these other pages -- the form's data is

Rewrite for an empty query string

风格不统一 提交于 2019-12-06 17:14:50
问题 I'm building in some caching to one of my sites, and I can't seem to find if there's a way to add a condition with mod_rewrite to apply only if the query string on a request is empty. For example, I'd love to know if I can have a request with no query string like http://www.example.com/ load the page at http://www.example.com/index.home.html But any request with a query string, such as http://www.example.com/?id=32 to load normally and not be affected by the rewrite. What am I missing? 回答1: I

http to https redirect - iis8.5 url rewrite 2.0 redirect rule not working

老子叫甜甜 提交于 2019-12-06 17:09:24
问题 I am having a hard time getting the below redirect rule to work... <rules> <rule name="Relative Path Rewrite" stopProcessing="false"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_URI}" pattern="^/$" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> <rule name="Ssl Redirect" stopProcessing="false">

How long does it take for .htaccess changes to take effect?

久未见 提交于 2019-12-06 17:04:07
问题 I have added url rewrite rules to my .htaccess file. Should I see these changes working right away? 回答1: Changes to .htaccess are immediate and do not require a restart. Normally, if you aren't seeing what you expect from .htaccess changes, you have a syntax error and should check Apache's logs for some idea of what's going on. 回答2: NVM found it. The .htaccess files follow the same syntax as the main configuration files. Since .htaccess files are read on every request, changes made in these

htaccess and no www

自闭症网瘾萝莉.ら 提交于 2019-12-06 16:09:09
问题 I am trying to redirect my whole site to non-www here is the htaccess code I am using # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress # no www RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.akorra\.com$ [NC] RewriteRule ^.*$ http://akorra.com%{REQUEST_URI} [R=301,L] any ideas 回答1: I think your rules need to between the module tags.

Rewrite URL using Apache for redirecting root domain

会有一股神秘感。 提交于 2019-12-06 15:57:19
I have this scenario where I would like to redirect my domains using the following scenario. Can you please advice if this can be achieved using RewriteRule in Apache? I would like to redirect any calls made using http://www.domainname.com/url to redirect to http://domainname.com/url . I was able to achieve the above using the following rewrite rule # BEGIN WithoutWWW RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.domainname\.com$ [NC] RewriteRule ^(.*)$ http://domainname.com/$1 [R=301,L] # END WithoutWWW If anyone tries to visit just http://www.domainname.com or http://domainname.com , I

Proxy_pass ignoring port

喜欢而已 提交于 2019-12-06 15:40:44
问题 I have a CentOS server running NGINX listening to 80 and a DB servering an app on 8080. I want to be able to Type http://example.com/dev/abc and have it actually access http://example.com:8080/apex/abc or http://localhost:8080/apex/abc I have used this location configuration location /dev { proxy_pass http://example.com:8080/apex; } However when I try it out the url displayed is http://example.com/apex/apex the page is not found and the log says: 2018/06/14 12:51:33 [error] 7209#0: *2067 open